How to Use 301 Redirects on a New Site for SEO

Written by - 17/11/2014

The vast majority of the time when we build a new site, the client we’re working with already has an established website that they’re replacing. This is incredibly valuable from a search engine optimisation perspective, as instead of launching the site completely afresh, existing link equity, domain authority, site visitors and many other factors can be maintained to ensure that their new website will already have an existing audience and search engine rankings to build upon.

It is always a primary concern that when we launch a new website, the redirects from the existing site are implemented as seamlessly as possible to ensure that maintaining these factors is done in the most efficient way available.

Redirecting to WWW or Non-WWW Versions Of Your Website

One of the first steps is to ensure that only one version of the website is being offered up. In Google’s eyes and are treated as entirely different pages, so if your website allows access to both, then it is likely your content will be crawled and indexed twice by search engine, creating big duplicate content issues.

Although it is important to ensure you are consistent in what is being used on your website, the choice between WWW or non-WWW URLs is really one that is mainly aesthetical. Non-WWW URLs allow your site address to display in browsers slightly shorter and cleaner, however WWW URLs conform slightly more to people’s traditional expectations of website. One thing to note however, is that by using a non-WWW version of your site, all cookies will be submitted to every subdomain of your site. Not a problem for most, but a consideration if you ever want to have a cookieless subdomain.

We’re big fans of WordPress and often use it for website builds. With WordPress it is incredibly simple to choose which version you want to serve up. Simply go to the Admin Control Panel, then go to Settings, then General, and the URL set in the WordPress address (whether WWW or non-WWW) will be the one that is automatically redirected to.

If you’re using a different or older content management system, it is likely that an option as simple as this won’t be available, so you’ll have to add a rewrite rule to your .htaccess file. Updating the example site below to your domain, should easily allow for you to redirect all pages on your site.

301 Redirect to WWW Version
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301,NC]

301 Redirect to non-WWW Version
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [L,R=301]

Redirecting to HTTPS or HTTP Version Of Your Website

With the public announcement by Google that secure sites would receive a slight ranking benefit in searches, and the continued fears over the integrity of unencrypted data transfers, more and more sites have made the shift to HTTPS. Whether you should or shouldn’t move to HTTPS and the various pros and cons of doing it is a whole other debate. However, much like with having WWW & non-WWW versions of a website, Google and other search engines will see these as different pages, meaning if both are accessible than you will have duplicate content issues. To avoid this a similar 301 redirect can be implemented using the following examples. If you are on WordPress however, the advice given in the previous example still holds true.

301 Redirect to HTTPS Version
RewriteCond %{HTTPS} off
RewriteRule (.*)$1 [R=301,L]

301 Redirect to HTTP Version
RewriteCond %{HTTPS} off
RewriteRule (.*)$1 [R=301,L]

301 Redirects From Individual Old Pages to New Pages

Once a standardize url has been settled on, the most common situation that we find is when a client is keeping their existing domain the same, but with a new site with entirely different URLs and even entirely different pages.

When this situation occurs, the first step is to establish a list of existing pages and by far the  easiest way to do this with Screaming Frog, a fantastic program for crawling websites that every web design company should have in their arsenal. The free version of the program allows for you to crawl up to 500 URLs with slightly limited features, which is passable for most sites small businesses, however for a larger sites you will need to have a licence to use the tool.

To crawl a website and generate a list of current pages, simply enter the URL and click ‘Start’. Once done, you can use the drop down filter in the top left to only show HTML pages and then use the Bulk Export feature to generate a spreadsheet containing the page URLs.

Once this is complete you have a simple list to ensure that all pages are redirected in the best way possible. Now the only real questions is of time. To ensure the very best results you should go through one by one and find the most appropriate page on the new website to redirect from the old website. Our preference of spreadsheet software is Google Sheets and if you open the exported URL list from Screaming Frog in it, assuming the old page URLs are in column A (this will be without the domain and only the trailing folder and page name – a simple find and replace can remove the domains), and you insert the new URLs in column B, then a simple concatenate reference copied down column C can give you all the redirects you need that can be copied straight into your htaccess file.

=CONCATENATE(“Redirect 301 “,A1,””,B1)

This will give you the following line, which allows a single page to be redirected to another single page.

Redirect 301 /old-page

Redirecting A Website Onto a New Domain

If your domain is changing, then the same formula and 301 can be used for redirecting individual pages, just ensure that the is changed to your new domain instead.

If however all of your pages and folders are keeping identical URLs, but only the domain is changing, then the following should be used in your .htaccess file.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^
RewriteRule (.*)$1 [R=301,L]

In this situation, the .htaccess file will check that it is being accessed from the new domain, and if not (which is what the exclamation mark tells it), then it will rewrite and 301 the existing page on the old domain, to the new domain.

Where should I redirect a specific page to?

Although for the majority of the time you’ll probably find that the old page on your website easily matches up to a new page that has been created, there’ll often be a variety of reasons why you might have to question where best to redirect the page to. A few of the main situations you may find are:

Redirecting Pages That Have Been Amalgamated

You’ll often find that with your new website you have streamlined the amount of pages you have for a better user experience. Perhaps before you had a ‘How to Find Us’ page and a ‘Contact Details’ page and an ‘Enquiry Form’ page, yet now these all exist on a simple ‘Contact’ page. If this is the case then you’re always best of 301ing all three pages to the new amalgamated version. There’s nothing wrong with having multiple pages redirecting to a single page, as long as it’s relevant and not for spammy purposes.

Redirecting Products or Services That No Longer Exist

If you have an ecommerce store or offer services, you’ll often decide that a redesign may be a good chance to rethink what you are actually offering and have a bit of a clear out. In this situation you’ll often be left trying to redirect pages that just don’t exist any more. As a rule of thumb, you’ll normally have the product or service within a parent category so redirecting it to this category page will be the most effective step to take, both from a user point of view and for search engines. If no parent category exists, then probably the closest possible service or product will be preferable, or perhaps a home page.

Redirecting Pages That Are No Longer Relevant

This is a bit of a tricky one. Perhaps you might come across a situation where you realise the pages on your old site that no longer exist are now entirely irrelevant to your business. With this kind of irrelevance it is unlikely that you will ever be able to redirect users to an appropriate page. In this situation it will probably still be most beneficial to redirect users to your homepage, rather than have them hit a 404 page and most likely bounce, however for such a little benefit it may often not be worth the effort for a large amount of pages. In this situation it is probably best to put your effort into ensuring that your 404 page is as useful to users as possible, and allow easy routes into the most relevant and recent content.

Redirecting Folders or Groups of URLS

Sometimes you may find that although your new site has changed significantly, that parts or segments of your URLs stay the same. When a pattern does exist, then it is possible for you to redirect URLs by batch using regex (or regular expressions). Below is an example of redirecting a folder, and all the subpages, to a new folder.

RedirectMatch 301 /old-folder/(.*) /new-folder/$1

If you are unfamiliar with regex, then as a brief starter a full stop “.”, means to match anything, an asterisk “*”, means to match any of the preceding characters and the parenthesis “()” encloses values that will then be stored to be used as a variable later. In this example therefore /old-folder/page would then be redirected to /new-folder/page. This is also true of the folder itself. This is probably the simplest occurrence, but there are a wide range of regex possibilities to be explored when attempting to match up patterned URLs.

Redirecting a WordPress Hosted Blog

This is another situation we have come across. And when I say a WordPress hosted blog, I don’t mean a website built on the WordPress CMS, but a blog actually on In this situation there is unfortunately no easy answer. Unfortunately, you have to purchase a site redirect upgrade ( directly from WordPress and this will give you very little control other than redirecting the whole blog to your new domain. Our advice in this situation is just to make sure you make the move sooner rather than later!

After Redirecting a Site

After you’ve exhausted yourself with ensuring all your 301s are correctly setup, you may think the fun is over, however there are a few more steps that you will need to do. Firstly, ensure that Google Webmaster Tools is setup on the domain you are directing to. If you are not changing domains, then just ensure that Webmaster Tools is set up on the domain you are planning on using.

If you are changing domains, then once all the work has been completed, go into the old site’s Webmaster Tools, click the gear icon in the top right, then click change of address and follow the instructions to use Google’s change of address tool. You should not however, that this tool does not support HTTP to HTTPS or sub domain changes currently.

Once this is done, ensure to monitor the success of your redirects in the ‘Crawl Errors’ report in Webmaster Tools, under the ‘Crawl’ section. The ‘Not Found’ tab will enable you to see any URLs that have not properly been forwarded on and are producing 404 errors as a result.