Make domain.com resolve to www.domain.com | South Coast Web Design Ltd
South Coast Web Design Ltd
Make domain.com resolve to www.domain.com Jan 26

tools
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..

2 Responses to “Make domain.com resolve to www.domain.com”

2D DesignDecember 24th, 2012 at 5:43 am

I really love your website.. Great colors & theme. Did you develop this site
yourself? Please reply back as I’m trying to create my very own website and want to learn where you got this from or exactly what the theme is called. Kudos!

Leave a Response


Top