UpT*_*eek 6 iis iis-7.5 301-redirect
在 IIS7.5 中将 301 重定向从非 www 'somedomain.com' 重定向到 'www.somedomain.com' 的最佳方法是什么?
谢谢
我建议您为 IIS 7安装 URL ReWrite 模块来为您执行此操作。你会添加一个看起来像这样的规则
<rule name="Canonical Host Name" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="true" pattern="somedomain\.com$" />
</conditions>
<action type="Redirect" url="http://www.somedomain.com{R:1}" redirectType="Permanent" />
</rule>
Run Code Online (Sandbox Code Playgroud)
有关URL ReWrite 的一些提示和技巧,请参阅本文。
归档时间: |
|
查看次数: |
3698 次 |
最近记录: |