Make domain.com resolve to www.domain.com
I keep doing SEO checks on sites and keep getting a SEO error :
http://www.domain.co.uk and http://domain.co.uk should resolve to the same URL, but currently do not.
Until recently I thought ‘oh well, this means I will get double the hits..’
I have since found out that Google and other search engines actually score this against you!
So after scanning numerous pages on google with hundreds of different methods of asking i stumbled upon this little bit of code..
In your main site add a file called ‘.htaccess’ if its not already there.
Open the .htaccess file with you favourite editting program and add the following :
RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.co.uk RewriteRule (.*) http://www.domain.co.uk/$1 [R=301,L]
Please remember to change the domain to your domain.
Save the file, flick over to firefox and try typing : http://domain.co.uk
This should now display as http://www.domain.co.uk
Voila, one happy SEO checker..