0
嗨我想重寫我的網址:www.mydomain.com/hw/Index.aspx到www.mydomain.com/hello-world/index.aspx 。這裏是我的代碼在web.config中:ASP.NET URL重寫和標記舊URL爲301
<rule name="Redirect to WWW" stopProcessing="true">
<match url="^hello-world/index.aspx" />
<action type="rewrite" url="hw/Index.aspx" />
</rule>
這個問題是我有兩個網址只有相同的頁面。
- www.mydomain.com/hw/Index.aspx
- www.mydomain.com/hello-world/index.aspx
我想什麼做的是當用戶瀏覽www.mydomain.com/hw/Index.aspx 它會被標記爲301並重定向到www.mydomain.com/hello-world/index.aspx
請幫助我。
在此先感謝。
嗨DavidG,與此問題是它會始終將我的網址重定向到** www.mydomain.com/hw/Index.aspx **而不是** www.mydomain.com/hello-world/index.aspx **。我需要的是** www.mydomain.com/hello-world/index.aspx **。請指教。 – user3274033 2015-03-25 00:56:18
您的規則只是回到前面,切換匹配值和動作url。 – DavidG 2015-03-25 01:19:37