3

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: enter image description here

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.

enter image description here

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

enter image description here

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.

6
  • How is it circular? It ends at the current URL. Commented Sep 24, 2022 at 22:50
  • @StephenOstermiller: please see my updated question Commented Sep 24, 2022 at 22:59
  • Search engines would have had no reason to test the /building-a-custom-canonical-url-in-python-java slug when it redirected. Unless you are swapping back and forth between two titles, I don't see how this would be an issue. Commented Sep 25, 2022 at 0:57
  • Its not circular but there are issues with changing a permanent redirect to a HTTP 200 OK success status response code indicating that the request has succeeded. It will take a longer period of time to get indexed than a 404 or a brand new URL. Commented Sep 26, 2022 at 1:38
  • I would note Tedster comments of 7:05 pm on Aug 14, 2010 on webmasterworld.com/google/4186382.htm ... Blackhats were trying 301 to 200 way back then, (they wanted to transfer their link juice and keep it to), and Google had build algos to make them stop ... In that case the site was taken over from another company, but the new poor soul had problems getting some of the 301 back to 200s. Commented Sep 26, 2022 at 2:00

2 Answers 2

2

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.

2

The redirect is not circular because even though the 301 is defined as permanent, there's very few permanent things on the web and Google recognizes it.

In short, Google reindexes permanent redirects to make sure they're still there. The frequency of that reindexing is a subject to quite complex logic whose aim is to avoid overloading the indexer while still allowing to keep essential pages perfectly indexed. In case of normal sites and not benchmark-class sites like SO, the frequency most often depends on backlinks to the 301 url.

Even without purposeful/forced reindexing, when the indexer Sees that A -> B first time, it may stop visiting A, but start visiting B. After it, when the indexer sees that now B -> A, it will definitely follow the redirection and reindex the A, updating its record in the DB, changing its status from 301 to 200.

No harm done, no perceived circular redirections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.