[英]IIS rewrite module - Encoded space at end of URL, looking for a rewrite rule to redirect the page
[英]Rewrite rule to redirect URL
我創建的URL為 - http:// localhost:13490 / level1 / XYZ / hulhbgma79
試圖重定向此URL - http:// localhost:13490 / level1 / PQR / HttpHandler.ashx?Id = hulhbgma79
在上面給出的URL示例中
我已經為這種情況編寫了規則 - 如下:
<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>
沒有按預期工作。
任何人都可以幫助我獲得相同的解決方案嗎?
<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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.