IIS 6重定向问题

时间:2018-12-04 10:34:26

标签: url-redirection iis-6

我想将我的网站distanceeducation360.com从非www重定向到www,但是以下代码对我不起作用。目前,我的网站托管在Linux服务器上,但我正尝试将其移至Windows VPS。我正在使用IIS6。请检查代码并确定我所缺少的内容。预先感谢。

<system.webserver>
<rewrite>
<rules>
<rule name=”Redirect to WWW” stopprocessing=”true”>
<match url=”.*”></match>
<conditions>
<add input=”{HTTP_HOST}” pattern=”^yourdomainname.com$”></add>
</conditions>
<action type=”Redirect” url=”http://www.yourdomainname.com/{R:0}” 
redirecttype=”Permanent”>
</action></rule>

<rule name=”Default Document” stopprocessing=”true”>
<match url=”(.*?)/?default\.aspx$”>
<action type=”Redirect” url=”{R:1}/”>
</action></match></rule>
</rules>
</rewrite>
</system.webserver>

0 个答案:

没有答案