SEO: 301 Redirect Non-www to www for Your WordPress Site

One of the biggest problems that online marketers have when trying to optimize their websites is in building online reputation and recognition across the internet. What many don’t understand is that yoursite.com and www.yoursite.com are, in the eyes of the search engines, two different websites.

The last thing you want to do is split all of your efforts and effectiveness in half by building equal credibility in your website with and without the www. There is a rather simple solution.

google primary domainThe first thing you need to do is to designate a primary domain in your Google Webmaster account. You will need to verify both versions of your website (with or without the www) and then navigate to the settings menu under “Site Configuration.”

After you tell Google what your primary domain is going to be you need to make two more changes to your website itself to make sure that anyone who comes to your site is forced into the correct version of your URL.

Firstly, login to your WordPress General Settings and make sure that your site’s URL matches the primary domain you entered into the Google Webmaster tools.

Next we need to do a little coding. You need to access your htaccess file from the main root directory. Using Filezilla or another FTP client, download your htaccess file to your computer. Make a copy of the file to keep as a backup in case you do anything wrong and need to put things back to their original setup.

Open the file using some type of text editor. I just use the notepad application that comes pre-installed on windows machines. Copy the following text below (in red) and paste them into your htaccess file.

RewriteEngine On

RewriteCond %{HTTP_HOST} ^example.com

RewriteRule (.*) http://www.example.com/$1 [R=301,L]

Change the “example” above with your website url. This will implement a permanent 301 Redirect to tell users and search engines alike that your previous two separate domains are now one and the same.

, , , , ,

4 Responses to SEO: 301 Redirect Non-www to www for Your WordPress Site

  1. Joe February 19, 2012 at 7:13 pm #

    Fascinating! I had no idea this was an issue. What should those of us who may not have root access to our servers do about this?

    • Jacob S Paulsen February 19, 2012 at 7:15 pm #

      Great question. I would do some more research. I’m not fully sure how else to go about the process.

  2. RAndy December 20, 2013 at 10:22 am #

    I recently purchased WordPress Hosting from Godaddy. I think I may have been screwed, everything I try WordPress is telling me I have to upgrade at an additional cost. Did I waste my money?

    • Jacob S Paulsen December 20, 2013 at 11:01 am #

      Sounds screwy to me. If you have a traditional web hosting plan from Godaddy then you should be able to host WordPress at no cost. WordPress is free open source software. Its possible that GoDaddy has some sort of WordPress only hosting plan somehow restricts features. I couldn’t speak to that.