簡體   English   中英

IIS重寫URL解碼規則失敗

[英]IIS Rewrite URL Decode rule fails

我正在嘗試轉換結構的網址

http://www.xyxyxh.com/ShowItem.aspx%3FID%3D947 

http://www.xyxyxh.com/ShowItem.aspx?ID=947 

我為IIS 7.5及更高版本編寫了以下URL重寫

<rewrite>
  <rules>
    <rule name="Convert" stopProcessing="true">
      <match url="^ShowItem.aspx/(.+)$" />
      <action type="Redirect" url="?q={UrlDecode:{R:1}}" />
    </rule>
  </rules>
</rewrite>

但規則失敗,並且網址無法轉換。 我要去哪里錯了?

例如,如果您檢查某些url解密工具

http://meyerweb.com/eric/tools/dencoder/

並粘貼在那里

http://www.xyxyxh.com/ShowItem.aspx%3FID%3D947

然后按解碼,您將看到

http://www.xyxyxh.com/ShowItem.aspx?ID=947

因此,除了簡單的url重寫之外,您還需要其他東西,或者根本不需要它,因為它相同嗎?

簡單的url重寫模塊對於例如轉換非常有用

從:

http:// localhost / article / 342 / some-article-title

至:

http://localhost/article.aspx?id = 342&title = some-article-title

您可以在此處找到更多詳細信息:

http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM