How a redirect works
When someone opens an old address, the server responds with code 301 and the new address instead of the page. The browser takes the visitor to the new location immediately and they usually do not even notice. Code 301 also tells search engines that the change is permanent. Google therefore replaces the old address with the new one in its index and passes on the value the old page had built up, including backlinks from other websites.
There is also a temporary redirect with code 302. Use it only when the page really will return to its original address, for example during short maintenance.
When you need it
- with a new website, when the URL structure changes,
- when changing domain, for example from .eu to .co.uk,
- when moving from http to https,
- when you discontinue a product or service and have a replacement,
- when you merge two similar pages into one.
Why it matters
Without redirects, old addresses lead to a 404 error. People who click an old link in Google results, in their bookmarks or on another website end up on an empty page. Google also gradually drops the old pages from its results and has to rank the new ones from scratch. After launching a nicer website, a company can lose a large share of its search traffic.
Example
A furniture shop is moving to a new system. Products used to have addresses like /produkt.php?id=152; the new ones look like /oak-dining-table. Before launch, a table is prepared that maps every old address to a new one. Categories are redirected to the new categories and discontinued products to the closest similar product or category. After launch, neither visitors nor Google notice much of a change.
Common mistakes
- Redirecting everything to the home page. Google often treats this as a broken page and the value is not passed on.
- Redirect chains. A leads to B, B to C. This slows down both the website and Google. Redirect straight to the target.
- Deleting redirects after a few months. Keep them in place permanently, or at least for several years.
When rebuilding websites, I pull the list of old addresses from Google Search Console and set up redirects before launch. It is part of my work on website design and build.