I am creating URL as - http://localhost:13490/level1/XYZ/hulhbgma79
trying to redirect this url on - http://localhost:13490/level1/PQR/HttpHandler.ashx?Id=hulhbgma79
In above given example of URL
I have written rule for this condition as bellow -
<rule name="RewriteURL" stopProcessing="true">
<match url="^XYZ\/((([A-Za-z0-9]+)(\s|&)([^\/]+))|(([^\/]+)(\s|&))|([^\/]+))\/?$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/PQR/HttpHandler.ashx?Id={R:9}" />
</rule>
not working as expected.
Can any one kindly help me to get the solution for the same?
<rule name="RewriteURL" stopProcessing="true">
<match url="(level\d)\/XYZ\/((([A-Za-z0-9]+)(\s|&)([^\/]+))|(([^\/]+)(\s|&))|([^\/]+))\/?$" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}/PQR/HttpHandler.ashx?Id={R:2}" />
</rule>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.