How to: Use 301 Redirects When You Launch a New Website

17th May 2018

When you go live with a content reshuffle or complete redevelopment, chances are that not all of your pages will remain in their old locations. But it’s those old locations that will still be indexed in Google, linked from other sites, and possibly in your visitor’s bookmarks. If the addresses no longer exist, your users will be confronted with a 404 error page, and Google will start removing them from its index.

An example:

I’ve just launched a new site for a client whose previous website was all built in static HTML pages. That’s just been replaced with a WordPress website, and every single page has a different address. /about.htm has become /about-us, /contact.htm has become /contact etc. They have around 37 pages indexed in Google, and only the home page is in the same place it was half an hour ago.

The solution: 301 redirects

301 redirects indicate a page has moved permanently, so that visitors get taken straight to the replacement page and Google knows to update its records.

How to implement 301 redirects

If you’re in WordPress then there are plugins, like Yoast’s SEO Premium, that will help you do this from the dashboard. I prefer the direct route though. If you’re on an Apache server and have access to the htaccess file, you can simply open it and add your redirects there. They follow a very simple format, one per line:

You might find that there’s already some stuff in your htaccess file, which you don’t want to tamper with. If it’s a WordPress site you’ve got, it’ll probably look something like this:

You can simply add your 301 redirects above or below this, and for good housekeeping bookend it with something like #BEGIN 301 Redirects and #END 301 Redirects. Once you’re sure you’ve redirected all the old pages to the new, you can save it and test they’re all working.

If you want to know what pages Google is indexing, you can go to search and enter site:yourdomain.com

We couldn’t believe our luck when Jo offered to build us our website for free. We were even more astounded when only weeks later we had a great site, purpose build to our needs. We couldn’t have paid for a better site or more fluid an experience of commissioning a website.

(Emma Gordon (Centre Manager, Bicester Green))