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
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.
/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.