![](/img/trans.png)
[英]Adding an attribute to an HTML tag using IIS Url Rewrite module outbound rule
[英]Outbound IIS Rewrite Rule not adding Parameter, what am I missing?
我想使用IIS Rewrite將/blog.aspx?Page=2更改為/ blog?Page = 2,但由於其地址位於DataPager中,所以它不是那么簡單。 為了解決這個問題,我提出了以下IIS重寫規則。
<outboundRules>
<rule name="BlogArticlesOutbound" stopProcessing="true">
<match filterByTags="A" pattern="^/blog.aspx\?page=([0-9]+)" />
<action type="Rewrite" value="/blog?page={R1}" />
</rule>
</outboundRules>
但是,輸出缺少頁碼,我需要怎么做才能對其進行更改以使其正常工作? 使用該規則時,樣式表似乎也從頁面中消失了。
您的反向引用語法有點錯誤。 您應該將其用作{R:1}
。
<outboundRules>
<rule name="BlogArticlesOutbound" stopProcessing="true">
<match filterByTags="A" pattern="^/blog.aspx\?page=([0-9]+)" />
<action type="Rewrite" value="/blog?page={R:1}" />
</rule>
</outboundRules>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.