301 Redirect WWW to Non-WWW

301 Redirect WWW to Non-WWWChances are you discovered that search engines see “two” of your websites.

Here’s how to use 301 to redirect www to non-www solving this problem.

If you are being consulted by an SEO company, one of the first things a reputable company will check is if you have a 301 redirect on your domain.

Why?

Simple, www.domain.com and domain.com are NOT the same domain in the eyes of the search engines.  They are two separate sites.  This results in duplicate content penalties and other issues hurting your efforts to rank.

Here’s a tip:  Visit your SEO company and check their domain.  Does their www.domain.com redirect to domain.com?  No offense, but this is basic SEO principles that have existed for a very long time and if your SEO company hasn’t done this, they don’t warrant the title of SEO.

You don’t have to take my word for it, here it is straight from Google:  http://support.google.com/webmasters/bin/answer.py?hl=en&answer=44231

Check your website:

1. Go to your www.domain.com

If www.domain.com is changed in the browser address bar to domain.com, then you have a 301 redirect in place.  This is good.

If not, this is one of the first things that needs to be addressed.

Why?

Simple, www.domain.com and domain.com are NOT the same domain in the eyes of the search engines.  They are two separate sites.  This results in duplicate content (as Google will only use content from one of the sites).  Ha ha…you caught me…yes I repeated this, but it’s that important.

It’s a common problem, but with an easy fix.

1. Use CPanel or via FTP, navigate to your public_html folder.

2. If you use CPanel make sure hidden files box is checked.

CPanel Show Hidden Files

3. Add to your .htaccess file the following (take care to NOT delete anything else that may already exist in your .htaccess file).

# Redirect www to non-www
RewriteEngine On
RewriteBase /
RewriteCond % ^www.linksgeek.com [NC]
RewriteRule ^(.*)$ http://linksgeek.com/$1 [L,R=301]

Naturally replace linksgeek.com with your domain.

4. Save the file

5. Access your domain at www.domain.com.

If it’s done correctly, you’ll be automatically redirected to domain.com.

If you have a webhost that doesn’t allow this to work, contact them for support.

Does this work for WordPress sites?

Yes.  We have this setup on all our client’s WP sites.  Just take note to not remove the existing commands in the .htaccess file.  Start on a fresh new line and you’ll be fine.  Can’t I just use a plug-in for this?  We love WordPrss plug-ins, but each plug-in forces more work on WP.  If you want a slower website, then use a plug-in for this, otherwise use the .htaccess solution.  Keep in mind slow sites are “nicked” a bit by Google.  Keep your plug-ins to a minimum.

Hopefully you’re humming along with a 301 redirect www to non-www with these simple yet helpful tips.

Subscribe

Subscribe to our e-mail newsletter to receive updates.

Comments are closed.