网站大改后重定向旧网址
我们最近将一个网站迁移到 ASP.NET MVC。 现在所有 URL 都与原始网站不同。 Google 仍然拥有我们所有的旧 URL,因此如果有人在搜索中找到我们,目前他们会收到 404。
我有一个包罗万象的路由,可以捕获不良 URL,包括所有旧 URL。 在完美的世界中,我希望对与此包罗万象的路由匹配的所有 url 进行 301 重定向到主页,并且我确实有可以在我的开发计算机上正常工作的代码。 然而,我最终让我们的 ISP(网络解决方案)人员告诉我,他们阻止 301 重定向(Web 服务器返回 404)。
所以我认为我唯一剩下的选择就是接受任何错误的 URL,并将其指向主页。
这是我的问题:我知道搜索引擎(尤其是谷歌)现在正在惩罚重复的内容。 如果我只是将所有不良网址都指向主页,这会对我们的搜索排名造成多大影响? 我还有其他技术选择吗?
We have a website which we recently migrated to ASP.NET MVC. All of the URLs are now different from the original website. Google still has all of our old URLs, so if anyone finds us in a search, currently they will get a 404.
I have a catchall route that catches bad URLs, including all of the old ones. In a perfect world I would like to do a 301 redirect to the home page for all urls matching this catchall route, and I do have code for this that works properly on my development machine. However, I finally got someone at our ISP (Network Solutions) to tell me that they block 301 redirections (the web server returns a 404 instead).
So I think my only remaining option is to just accept any bad URL, and point it to the home page.
Here is my question: I know that the search engines (especially Google) are now penalizing duplicate content. If I just point all bad URLs to the home page, how much is this going to hurt us in the search rankings? Do I have any other technical options?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
老实说,我建议你更换ISP。 301 是任何网站管理员工具箱中的重要工具,如果他们阻止它,将会给您带来严重的惩罚。 您可以轻松地将域转移到另一个 IP 地址,等待 DNS 传播,然后进行部署。
来自 Google 的网站管理员工具:
我确信说起来容易做起来难,但我绝对不希望 ISP 对他们的客户施加这种过滤。
Honestly, I would suggest that you change ISP's. 301's are an important tool in any webmaster's toolbox, and for them to block that will penalize you terribly. You could easily transfer your domain to another IP address, wait for the DNS propagation, and then do your rollout.
From Google's Webmaster tools:
I'm sure that's much easier said then done, but I would never want an ISP that exerted that kind of filter against their clients.
至少可以做一个302重定向吗? 我确实同意 womp 所说的,但是哪个 ISP 会阻止 301 重定向? 扔掉它们。 ISP 是一毛钱一打。
Can you do a 302 redirect at least? I do agree with what womp says though, what ISP would block 301 redirects? Dump them. ISPs are a dime a dozen.
我完全同意womp的观点。 我不敢相信 ISP 会阻止 301。
我很惊讶您无法在网络解决方案上执行 301 重定向,因为它们不完全是两位操作。
他们自己的营销材料建议您可以这样做。 还有一个 论坛由想要进行 301 重定向的人发布。 尽管他们使用 .htaccess,但 Network Solutions 技术支持的回复向用户展示了如何在 ASP 中执行 301 重定向。
I completely agree with womp. I cannot believe that an ISP would block 301's.
I was so surprised that you can't do a 301 redirect on Network Solutions, because they're not exactly a two bit operation.
Their own marketing material suggests that you can. There's also a forum post by someone wanting to do a 301 redirect. Although they use a .htaccess, the reply from a Network Solutions tech support shows the user how to do a 301 redirect in ASP.
如果您选择不更改 ISP,那么最简单的解决方案是显示一个页面,其中您说该页面已移动,并带有指向新页面链接的链接,然后添加 5 秒的延迟,使用 HTML 元标记进行重定向:
或者您可以使用 URL 重写器,这样旧的 url“指向”新页面,基本上有两种方法可以做到这一点,以编程方式创建您自己的 VirtualPathProvider,第二种方法是使用 URL 重写器模块,例如 IIS URL 重写模块。
If you opt to not change ISP then the simples solution is to display a page where you say that the page has been moved with a link to the new page link, then you add a 5 second delay that re-directs using a HTML meta tag:
Alternatively you could use a URL rewriter, that way the old url "points" to the new page, there are basically two ways of doing this, the programmatically way is to create your own VirtualPathProvider, the second way is to use a URL Rewriter module like the IIS Url Rewrite Module.