301 or 302 – When And Why

Why redirect?

There are two primary types of redirects available to a developer 301 redirects and 302 redirects. When would somebody consider using a redirect?

  • The URL is broken or it doesn’t work
  • The webpage/site is no longer active
  • You have a new webpage/site that you want people to visit instead of the old one
  • You’re A/B testing a new webpage in terms of design or functionality
  • You’re fixing a webpage and you want to temporarily make a detour for your users for continual website experience

The 301 Redirect

The 301 redirect is permanent – meaning it should be used when you want to permanently redirect a page. Essentially, the new page will completely replace the old page that you are redirecting from.

The 302 Redirect

The 302 redirect is temporary – meaning it should be used when you want to temporarily redirect a page. If you accidentally use a 302 redirect it will hurt your sites Search Engine Optimization because the old page will still contain all of the important data.

Leave a Reply

Your email address will not be published. Required fields are marked *