【发布时间】:2011-02-14 20:32:30
【问题描述】:
在阅读了 Google Webmaster Central Blog(官方博客)上的这篇文章“Slash or not to slash”(链接:http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html)后,我决定测试我的 ASP.NET MVC 应用程序。
例如: http://domain.com/products 和 http://domain.com/products/(末尾有“/”)返回代码 200,表示:Google 将其理解为两个不同的链接,很可能是“重复内容”。他们建议选择您想要的方式...带或不带破折号,并创建一个 301 永久重定向到首选方式。
因此,如果我选择不带破折号,当我尝试访问 http://domain.com/products/ 时,它将返回 301 到不带破折号的链接:http://domain.com/products。
问题是,如何使用 ASP.NET MVC 做到这一点?
谢谢, 桂
【问题讨论】:
标签: asp.net asp.net-mvc seo url-rewriting http-status-code-301