One of the things you need to decide when setting up your self-hosted WordPress blog is whether you want a www or non-www domain. For example:
http://www.example.com OR http://example.com
Which one is better?
Well, I’ve no intention to start an argument on this topic. Like many, I would agree that this is just a matter of taste. And you just got to choose one.
Okay, let me put it this way, there’re many top sites or blogs that fall into either one of these categories. Therefore, whichever option you choose, you won’t be dead wrong.
Once you’ve made up your mind, you need to specify that on your WordPress settings. For this tutorial, let’s pick the non-www version. Go to WordPress Dashbord > Settings > General and enter the non-www URL in both WordPress Address (URL) and Site Address (URL) fields.
Once done, WordPress is kind enough to do a 301 redirect from www to non-www. Nope, you don’t need to enter the redirection codes in .htaccess anymore.
Adding your site and setting preferred URL on Google Webmaster Tools
Now, you can use the Google Webmaster Tools to tell Google your preferred domain. With this, you are actually telling Google which URL you would like to be crawled, indexed and shown on search results.
But prior to setting your preferred URL, you need to add your site record to the Webmaster Tools first.
Sounds complicated ? Don’t worry this post will show you the complete process from adding a site to setting the preferred URL.
- Login to Webmaster Tools.
- On the Webmaster Tools homepage, click the ADD A SITE button on the right. You’ll see a pop up text box that lets you enter your site URL. Enter the www URL here and click Continue.
- Now, Google will ask you to do a verification – Google has to do this to ensure you really are the admin of the site.
- Download the html verification file by clicking “this HTML verification file” link.
- Using FTP client, upload the file to your web root directory. If it’s a primary domain, put the file in public_html directory, else upload it to public_html/addon_domain/ for an addon domain.
- Now, you can browse the html file on your site to confirm you have uploaded it successfully.
- Click the VERIFY button.
- If everything is done correctly, you will see a congratulatory message, confirming your site has been added to the Webmaster tools.
- Now, you need to add the non-www version of your site to the Webmaster tools. Go back to the Webmaster Tools homepage and click the ADD A SITE button again.
- For this round, enter your site WITHOUT www and click Continue.
- Again, you need to verify that the non-www site is also owned by you. But for this round, you can SKIP task 1 to 3, and click VERIFY.
- You should see a congratulatory message, confirming your non-www site has been added to the Webmaster Tools.
- Now, you can specify your preferred URL. On the Webmaster Tools homepage, click the www site link to get into the site Dashboard.
- On the Dashboard page, go to Configuration > Settings.
- Select your preferred domain and click Save to complete the whole process.