大网数据广告活动
网站运营与故障问答

Is there any problem with circular permanent redirects?

· 52CE 我爱测

In e-commerce websites, we want to include product title in the URL for SEO benefit... however the title is not unique so we generally include an id along with the title. The title is determined by the user, so they may change it…

问题原文

原帖链接 · Hooman Bahreini · CC BY-SA 4.0

In e-commerce websites, we want to include product title in the URL for SEO benefit... however the title is not unique so we generally include an id along with the title.

The title is determined by the user, so they may change it to anything they want...

This is exactly the same situation that happens in stackoverflow, as descrived below:


The question link structure on stackoverflow is:

https://stackoverflow.com/questions/id/comma-separated-title

For example:

The correct URL: https://stackoverflow.com/questions/73793686/building-a-custom-canonical-url-in-python

If I change the URL to: https://stackoverflow.com/questions/73793686/building-a-custom-canonical-url-in-python-java

I will get a permanent redirect to the correct link.

Now I go ahead and change the question title in stackoverflow:

This time if I send a request for:

https://stackoverflow.com/questions/73793686/building-a-custom-canonical-url-in-python

I will get redirected to:

https://stackoverflow.com/questions/73793686/building-a-custom-canonical-url-in-python-java


I want to follow the above approach in my e-commerce website (for SEO purposes) however I am not sure if there is any issue with having circular permanent redirects, like above?


How is it circular?

Originally I told Search engines

.../building-a-custom-canonical-url-in-python

should be redirected to:

.../building-a-custom-canonical-url-in-python-java

Now I am telling the search engines that:

.../building-a-custom-canonical-url-in-python-java

should be redirected to:

.../building-a-custom-canonical-url-in-python

So if the router/search engine/browser remembers my instruction, this could end up in an infinite loop... it practice it does not.

But is there any issue with the above approach? One can argue that we are misguiding the routers by giving them contradictory instructions.

已采纳解答

原帖链接 · Maximillian Laumeister · CC BY-SA 4.0

BNazaruk's answer covers the SEO side of things; I want to address the browser side.

When web browsers sense that their cached 301 would cause a circular redirect, they invalidate their cache and re-fetch the redirected URL anew. So, cached redirects cannot cause circular redirection in modern mainstream web browsers.

Basically, not only is there no SEO issue with the redirect pattern you described, but there's no browser issue either. It's a perfectly fine pattern to use.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2022-09-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。