O'Reilly logo

The Art of SEO by Jessie Stricchiola, Rand Fishkin, Stephan Spencer, Eric Enge

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Redirects

A redirect is used to indicate when content has moved from one location to another. For example, you may have some content at http://www.yourdomain.com/old.html and decide to restructure your site. As a result of this move, your content may move to http://www.yourdomain.com/critical-keyword.html.

Once a redirect is implemented users who go to the old versions of your pages (perhaps via a bookmark they kept for the page) will be sent to the new versions of those pages. Without the redirect, the user would get a Page Not Found (404) error. With the redirect, the web server tells the incoming user agent (whether a browser or a spider) to instead fetch the requested content from the new URL.

Why and When to Redirect

Redirects are also important for letting search engines know when you have moved content. After doing so, the search engines will continue to have the old URL in their index and return it in their search results. The solution to this is to implement a redirect. Here are some scenarios in which you may end up needing to implement redirects:

  • You have old content that expires, so you remove it.

  • You find that you have broken URLs that have links and traffic.

  • You change your hosting company.

  • You change your CMS.

  • You want to implement a canonical redirect (redirect all pages on http://yourdomain.com to http://www.yourdomain.com).

  • You change the URLs where your existing content can be found for any reason.

Not all of these scenarios require a redirect. For example, you can change ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required