[英]IIS8 and URL redirect using URL Rewrite Module
我在Server 2012 R2 Web服務器上運行兩個站點:
現在,用戶必須輸入主機名,端口號和子文件夾才能查看“第二站點” http://webServer:1234/subFolder
。
我正在嘗試簡化URL,以便所有用戶都可以輸入URL site.myDomain.com
並將其(永久)重定向到site.mydomain.com:1234/subFolder
。
我嘗試在我的secondSite上應用以下規則:
<rewrite>
<rules>
<rule name="Redirect" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="http://site.mydomain.com:1234/subFolder" />
</rule>
</rules>
</rewrite>
但是似乎什么也沒做。
DNS中已經為site.myDomain.com
配置了CNAME
記錄,以解析為http://webServer
。
我只需要獲得有關重定向到端口1234的“ secondSite”的幫助。
我假設第一個站點托管在IIS上,並且規則在第一個站點的上下文中運行。 如果是這樣,它應該可以工作……以驗證您的設置,我將從本文開始,然后從您的用例開始:
<configuration>
<system.webServer>
<httpRedirect enabled="true" exactDestination="true" httpResponseStatus="Found">
<add wildcard="/some/folder/path/" destination="/new/folder/" />
</httpRedirect>
</system.webServer>
</configuration>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.