: 301 or 302 for url that changed but new page might exist in old url I have pages for usernames. e.g. http://mydomain.com/user/<username> I'm trying to handle the case a user changes his
I have pages for usernames.
e.g. mydomain.com/user/<username>
I'm trying to handle the case a user changes his username. What kind of redirect from old username url to new username url should I do? I would want a 301 to keep link juice but am concerned about what will happen when another user uses the same old username making the url live again.
More posts by @Rambettina238
2 Comments
Sorted by latest first Latest Oldest Best
From an SEO standpoint, 301 redirects are almost always better than 302 redirects.
However, one difference between 301 and 302 redirects is how browsers cache them. 301 redirects are cachable whereas 302 redirects are not. Using a 301 redirect introduces this buggy senario:
User visits redirecting URL and gets sent to page A at its new location
You launch a new page B at the old URL of page A.
The user clicks on a link that should go to page B.
The user gets redirected to page A because the 301 redirect is cached by the user's browser
This chain of events seems fairly unlikely if:
The URL has been redirecting to the new home of page A for some time (weeks or months) before page B has launched (to give search engines the chance to index page A at its new location.)
All internal links to page A point to the new URL of page A
There are few external links into the old URL for page A and not many users click on them.
301.
It specifies that the current document has moved permanently from the old URI to the new URI. It doesn't say anything against a new document appearing against that URI one day.
Google will recrawl the page when it sees links to it, or finds it in a sitemap, and upon seeing the 200 code that it'll return when it is valid again, will index it.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.