网站大改后重定向旧网址

发布于 2024-08-01 21:22:39 字数 438 浏览 7 评论 0原文

我们最近将一个网站迁移到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

陌若浮生 2024-08-08 21:22:39

老实说,我建议你更换ISP。 301 是任何网站管理员工具箱中的重要工具,如果他们阻止它,将会给您带来严重的惩罚。 您可以轻松地将域转移到另一个 IP 地址,等待 DNS 传播,然后进行部署。

来自 Google 的网站管理员工具:

使用 301 重定向永久
将旧网站上的所有页面重定向到
您的新网站。 这告诉搜索
您的网站拥有的引擎和用户
永久移动。 我们建议
您移动并重定向一个部分或
先目录,然后测试make
确保您的重定向有效
在移动所有之前正确地
内容。

不要进行单一重定向定向
从您的旧网站到您的所有流量
新主页。 这将避免404
错误,但它不是一个好的用户
经验。 这是更多的工作,但
页面到页面重定向会有所帮助
保留您网站在 Google 中的排名
同时提供一致且
为您的用户提供透明的体验。
如果不会出现 1:1 的比赛
旧网站和新网站上的页面
网站(推荐),尝试确保
您旧网站上的每个页面都位于
最少重定向到新页面
类似的内容。

我确信说起来容易做起来难,但我绝对不希望 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:

Use a 301 Redirect to permanently
redirect all pages on your old site to
your new site. This tells search
engines and users that your site has
permanently moved. We recommend that
you move and redirect a section or
directory first, and then test to make
sure that your redirects are working
correctly before moving all your
content.

Don't do a single redirect directing
all traffic from your old site to your
new home page. This will avoid 404
errors, but it's not a good user
experience. It's more work, but a
page-to-page redirect will help
preserve your site's ranking in Google
while providing a consistent and
transparent experience for your users.
If there won't be a 1:1 match between
pages on your old site and your new
site (recommended), try to make sure
that every page on your old site is at
least redirected to a new page with
similar content.

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.

若水微香 2024-08-08 21:22:39

至少可以做一个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.

宁愿没拥抱 2024-08-08 21:22:39

我完全同意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.

四叶草在未来唯美盛开 2024-08-08 21:22:39

如果您选择不更改 ISP,那么最简单的解决方案是显示一个页面,其中您说该页面已移动,并带有指向新页面链接的链接,然后添加 5 秒的延迟,使用 HTML 元标记进行重定向:

<html>
<head>
<title>Page moved</title>
<meta http-equiv="refresh" content="5;url=http://example.com/newurl">
</head>
<body>
The page has been moved, click <a href="http://example.com/newurl">here</a> if you have not been re-directed to the new page within 5 seconds.
</body>
</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:

<html>
<head>
<title>Page moved</title>
<meta http-equiv="refresh" content="5;url=http://example.com/newurl">
</head>
<body>
The page has been moved, click <a href="http://example.com/newurl">here</a> if you have not been re-directed to the new page within 5 seconds.
</body>
</html>

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文