[英]IIS URL Rewrite - IIS 7
我是使用IIS網址重寫的新手。 我安裝了它並使用IIS設置了一條規則,但是當我嘗試訪問本地主機中的URL時沒有任何反應。 下面是IIS放在我的web.config中的內容。 當我訪問此網址mysite / srcc_development_2012 / login / default.aspx時,根據我設置的規則,應將其重定向到google,但它不起作用。 我想念什么?
<rewrite>
<rules>
<rule name="SRCC" patternSyntax="Wildcard" stopProcessing="true">
<match url="mysite/srcc_development_2012/*" />
<action type="Redirect" url="http://www.google.com" />
<conditions logicalGrouping="MatchAny">
</conditions>
</rule>
</rules>
</rewrite>
我知道這是一個較舊的主題,但未得到回答,並顯示在搜索中。
這是我將如何執行此操作:
<rewrite>
<rules>
<rule name="SRCC" stopProcessing="true">
<match url="(.*)" ignoreCase="true" />
<conditions>
<add input="{URL}" pattern="^srcc_development_2012(.*)?" />
</conditions>
<action type="Redirect" url="http://www.google.com" />
</rule>
</rules>
</rewrite>
in的值是域之后的值(stackoverflow.com/THIS/IS/THE-URL,其中stackoverflow.com是{HTTP_HOST}(但我們對此規則不予使用))。
以下之一應該工作:
但是請確保將此規則添加到登錄文件夾。
<rule name="redirect" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="https://google.com" />
</rule>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.