[英]301 redirection - Trailing Slash web.config
I want to do permanent 301 redirect from http://www.example.com/ to http://www.example.com . 我想从http://www.example.com/到http://www.example.com进行永久301重定向。
I had tried below code in web.config, but not working. 我曾尝试在web.config中使用以下代码,但无法正常工作。 Is there anything other changes I have to do?
我还需要做其他更改吗?
<rule name="SEO - Remove trailing slash" stopProcessing="false">
<match url="(.*)/$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="{R:1}" />
</rule>
You don't need to redirect the root domain, read this 您无需重定向根域,请阅读此内容
http://googlewebmastercentral.blogspot.co.il/2010/04/to-slash-or-not-to-slash.html http://googlewebmastercentral.blogspot.co.il/2010/04/to-slash-or-not-to-slash.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.