问题描述
最近我将一个ASP.net站点迁移到ASP.net MVC站点。之前有两个主机标头,一个是mydomain.com,另一个是www.mydomain.com。我的SEO说,您应该只使用一个网址 www.domain.com来获得SEO优势。
Recently I migrated an ASP.net site to ASP.net MVC site. Earlier there were two host headers one mydomain.com and another is www.mydomain.com. My SEO says you should use only one url "www.domain.com" for SEO advantage.
我正在寻找一种可以对所有mydomain.com进行301永久重定向的选项请求到www.mydomain.com。
I am looking for an option to do 301 permanent redirect all mydomain.com request to www.mydomain.com.
该站点托管在IIS6中,并在ASP.net MVC 4中开发。
The site is hosted in IIS6 and developed in ASP.net MVC 4.
推荐答案
不幸的是, URL重写模块不适用于IIS6 (仅IIS7或更高版本)。您是否考虑过创建自己的HttpModule,像这样?
Unfortunately, the URL rewrite module does not work with IIS6 (only IIS7 or greater). Have you considered creating your own HttpModule, something like this this?
或者您可能会使用第三方解决方案,例如以下一种:
Or you could potentially use a 3rd party solution like one of these:
这篇关于ASP.net MVC网站:将所有“非WWW”重定向到要求万维网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!