[英]Redirect only default.aspx on the root folder web.config
http://foo.com/about/Default.aspx
http://foo.com/random/Default.aspx
<rule name="Default Document" stopProcessing="true">
<match url="(.*)default.aspx" />
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
這會將所有 /Default.aspx 重定向到 /
我只需要根目錄上的 Default.aspx 重定向到 /。 那怎么辦呢? TIA
最后,能夠讓它工作。
<rule name="root home" stopProcessing="true" patternSyntax="ExactMatch">
<match url="Default.aspx" ignoreCase="true" />
<action type="Redirect" url="/" redirectType="Permanent" />
</rule>
patternSyntax="ExactMatch" 是解決問題所需要的。 謝謝你的幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.