301 or 302 for url that changed but new page might exist in old url

301 or 302 for url that changed but new page might exist in old url - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the 301 or 302 for url that changed but new page might exist in old url error on your web browser. Problem :


I have pages for usernames.
e.g. http://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.


Solution :

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.



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:




  1. User visits redirecting URL and gets sent to page A at its new location

  2. You launch a new page B at the old URL of page A.

  3. The user clicks on a link that should go to page B.

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


We hope that this article has helped you resolve the seo, redirects, error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

Redirected urls show in serp, with the original permalink but with the title and meta of the target page

How can I redirect everything but the index as 410?

How do I redirect traffic only if being accessed from a specific port?