What is a 301 redirect?
When someone requests an old address, the server does not answer with the page but with the status code 301 “Moved Permanently” and the new address. The browser then loads the new page straight away. Our entry on HTTP status codes explains which other status codes exist and how Google handles 404 or 410.
According to Search Central, a permanent redirect is a signal to Google that the target is the authoritative, or canonical, address. Typical reasons are:
- a new URL structure after a relaunch,
- a move to a new domain,
- switching from http to https or from an address without www to one with www,
- two pages on the same topic being merged into one.
301, 302, 307 and 308: which redirect when?
Google distinguishes only two groups: permanent and temporary.
- Permanent: 301 and 308. Both tell Google that the new address should be indexed. The difference only matters to the browser: with 308, the type of request is preserved, so a submitted form is also sent as a form to the new address. For normal pages, 301 is the usual choice.
- Temporary: 302, 303 and 307. Google then often keeps the old address in its index. This suits, for example, a campaign page that redirects to another offer for just a few weeks, or a product that is temporarily out of stock and points to an alternative.
There are also redirects outside the server. Google treats an instant meta refresh in the HTML as a permanent redirect and a delayed one as temporary. Google only recommends JavaScript redirects if nothing else is possible, because rendering the page can fail, in which case Google does not see the redirect.
An avoidable mistake: a permanent change is accidentally set up as a 302. So always check which code is actually returned.
Setting up 301 redirects
Google recommends setting up permanent redirects on the server wherever possible. Depending on the system, there are different ways to do this:
- Apache: in the .htaccess file, for example with
Redirect 301 /old-page/ https://www.example.co.uk/new-page/. - Nginx: in the server configuration with the
return 301directive. - Content management systems: in WordPress and other systems, SEO or redirect plugins handle the management.
- Upstream services: content delivery networks and hosting dashboards often offer their own redirect rules.
It is important that the rules are maintained in one place. If redirects sit in the server, the CMS and the content delivery network at the same time, chains and loops easily arise that nobody can keep track of.
301 redirects during a relaunch
During a relaunch, hundreds of addresses often change at once. In its guide to site moves, Google describes the procedure. The key points:
- Create a mapping: every old URL is assigned the new URL with matching content. Pages with rankings, visitors and backlinks take priority.
- Not everything to the home page: if many old addresses redirect to a page without matching content, Google treats this as a soft 404. For content that has been removed without replacement, 404 or 410 is more honest.
- Straight to the target: each redirect should point directly to the final address without intermediate steps. Chains left over from earlier relaunches should be resolved at the same time.
- Update internal links and canonicals: internal links and canonical tags point to the new addresses, not the old ones.
- Submit sitemaps: alongside the new XML sitemap, temporarily submit a sitemap with the old addresses. This lets you see in Search Console how indexing shifts to the new addresses. Once the move is complete, remove the old sitemap again.
- Keep them for a long time: Google advises keeping redirects for as long as possible, generally at least one year.
Even when everything is done properly, rankings can fluctuate temporarily during the move. Our article Typical errors when relaunching a website describes further common pitfalls. How we support a relaunch is described on our SEO relaunch page.
Checking redirects
For individual addresses, the network tab in the browser’s developer tools or the URL Inspection tool in Search Console is enough. For a whole list of old addresses, our HTTP status code checker or a crawler is suitable. Check for each address:
- Does the old address return 301 or 308, not 302?
- Does the target respond with 200 and not with another redirect or an error?
- Are there loops where two addresses point to each other?
- Does the target match the content of the old page?
After going live, the page indexing report in Search Console shows whether Google recognises the old addresses as redirected.
Are you planning a relaunch or a domain change and do not want to lose rankings? Then get in touch with us or read more about our SEO relaunch support!
