Matt Beswick


Digital Strategist and SEO Consultant
  • Home
  • Services
    • PPC Consultant
    • SEO Coaching
    • SEO Training
  • Geek Blog
    • SEO and PPC
    • Social Media
  • — Get in Touch / Hire Me —
SEO and PPC, Technical SEO 0

Redirecting non-www to www

By Matt Beswick @mattbeswick ·

Search engines think of http://yourweb.com and http://www.yourweb.com as completely different domains, meaning that you are potentially splitting the value of your website content by keeping them separate. Fortunately there’s an easy fix by using a 301 redirect.

What is a 301 redirect?

Put simply, a 301 redirect tells a search engine that one page has been permanently moved to another location. A 301 can be used in a variety of cases but this example will point all non-www traffic to www.

Creating the 301 redirect

1. Ensure that your server has the Apache Rewrite Module activated (If you’re unsure, contact your web hosting provider).

2. FTP into your site, download the .htaccess file from the root folder of your site, and make a backup (just in case things go wrong!)

3. Add the code below to the .htaccess file, save it, and upload to your site (remember to change yourweb.com to whatever your site is):

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yourweb.com [nc]
rewriterule ^(.*)$ http://www.yourweb.com/$1 [r=301,nc]

4. Lauch your web browser and go to http://yourweb.com. If you’re redirected to http://www.yourweb.com/ everything’s fine. Check your site over to make sure that no pages are broken and that’s it – done.

If there’s anything broken or your site won’t load, restore the .htaccess file that you backed up earlier and upload it to your site. There’s plenty that could go wrong so if you’re unsure I’d definitely advise getting in touch with your hosting provider to see if they’ll help.

Share this:

  • Twitter
  • Facebook
Share Tweet

Matt Beswick

Web Junkie, SEO consultant, Social Media Enthusiast and Dog Lover. Above everything else, loves sleeping. Find him on Twitter - @mattbeswick.

You Might Also Like

  • SEO and PPC

    How to send email with an AdWords script

  • SEO and PPC

    AdWords MCC Scripts – Beginner’s Guide

  • SEO and PPC

    The Big Guide to Outsourcing

No Comments

Leave a reply Cancel reply

Twitter

Tweets by @mattbeswick

About Matt

This blog is my outlet to write about things I love. Developing a number of successful Facebook games introduced me to start-up life, and I've since moved onto freelance as an SEO consultant before co-founding Aira, a digital agency based in Milton Keynes.

I'm also a frequent speaker in the SEO / Digital Marketing industry, which started because I hate networking and needed to find a way to get people to come and talk to me.

The site is constantly evolving, with posts appearing and disappearing, but if you'd like to reach out feel free to get in touch on LinkedIn, Twitter, or Facebook.

Remember, if you're looking for an SEO Consultant, digital marketing expert or digital strategist... or just fancy a chat... please feel free to get in touch - I'd love to hear from you! I cover Milton Keynes, Northampton, and surrounding areas.

© Matt Beswick. Digital strategist & SEO consultant. All rights reserved.