WordPress users: How to consolidate your link love!
Posted by FrankPIf you are using a hosted version of WordPress then you may find this article useful, it will help you check if your links are split between www.yoursite.com and yoursite.com and it will help you consolidate those links, which should help with your search engine results.
You may have heard talk of ‘canonical url’s', a canonical url is the authoritative url for your site – your site might be attainable through several urls for example www.aonach.com and aonach.com (no www!).
Some search engines may see these to url’s as separate entities.
I’m not going to go into duplicate content issues too much here, except to say that some search engines may see two versions of exactly the same site if your site resolves to both www.yoursite.com and yoursite.com.
Google generally say you won’t be penalised for www & non-www but all the same they recommend you ensure you indicate your canonical url (see Google article on duplicate content).
What I do want to quickly look at is your inbound links.
But first, let’s check if this is an issue on your site. Go to your site using www.yoursite.com and make sure you check that the url is the same when the page is fully loaded. Does it still read www.yoursite.com? Now go to yoursite.com (don’t type www) and again check how the url reads when your page is fully loaded – does it still not have the www?
If you have managed to load your homepage at both www.yoursite.com and yoursite.com then you need to read on!
You may be splitting your inbound links between the two. In other words, some people may be linking to www.yoursite.com and others to yoursite.com. If you want to check, go to Google and do a search for link: www.yoursite.com and note the estimated number of links (the figure will be displayed on the right hand side of the blue bar running along the top of the results page). Then search for link: yoursite.com and note the number of estimated links.
If they are different numbers it’s more than likely because people are indeed linking to the www and non-www versions of your site. You may experience better search engine results if you consolidate your inbound links.
What you can do is set up a permanent redirect from one url to the other using htaccess – if that sounds complicated, don’t worry it’s not.
You can choose either to redirect all traffic to www.yoursite.com or to yoursite.com. I always redirect to the non-www version, because I think that’s the way to go – a lot of people nowadays talk about urls without the www. They say ‘flickr.com’ or ‘twitter.com’. Your redirect will ensure anyone who still thinks ‘www’ when they think of a site will still get to you, but you’re choosing the non-www version as your canonical url.
You will need to FTP into your site – if you have a hosted WordPress solution you should have ftp access. If you don’t you will need to contact whoever is in charge of your website and maybe point them toward this article and ask them to do it for you.
Before we go on, I recommend you back up the htaccess files you are about to change so that you know you have a working copy to return to if you make any mistakes!
FTP into your WordPress folder and download the htaccess file (it’s called ‘.htaccess’). You may need to find the option for showing hidden files in your FTP client – or just use FireFTP with the Firefox browser!
Open it with a plain text editor like WordPad. If you are using permalinks (and I recommend you do!) you should see something like this:
# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>
# END WordPress
change it to this:
# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</ifmodule>
# END WordPress
You will need to change where it says ‘yoursite’ and ‘.com’ to whatever your domain is.
What if you have a site with your wordpress blog in a subfolder?
For example yoursite.com with your blog at yoursite.com/blog
In that case your wordpress .htaccess should be changed so that it looks like this:
# BEGIN WordPress
<ifmodule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://yoursite.com/blog/$1 [R=301,L]
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</ifmodule>
# END WordPress
You will also have to do a permanent redirect at the root of your site – if you don’t have a htaccess file at your sites root already (where your hompage is) then open up a plain text editor and paste in the following:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.yoursite\.com$ [NC]
RewriteRule ^(.*)$ http://yoursite.com/$1 [R=301,L]
Once again, remember to change your domain details in the above code!
Save the text document as htaccess.txt and close it, upload the file to your site root and rename it to ‘.htaccess’.
Finally, remember to test your site to make sure everything is working as it should be!







March 28th, 2008 at 1:44 pm
I think your redirection method will only redirect traffic. Will it add up the backlinks ? I don’t think so.