Hello everyone,
Sorry it has been a while since my last post, I’ve been busy doing personal projects away from this website. Just a quick note on how to change your web address from non www to www (eg http://www.daveberry.co.uk).
Its important to include this script on your website if you want to stay on the good side with search engines. By including this you are stopping Google .etc from seeing duplicate content! This will force users who visit your website without “www” in the domain to be redirected to the
relevant file with “www” at the beginning. By using a 301 redirect we are also telling the search engines that this address has changed
permanently to the “www” address.
Don’t worry if you don’t understand above, the code can be simply copied and pasted in!
To do this all you have to do is include the following script in your .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L
The .htaccess file is a file stored in the root directory of your web server. If you can not find the file simply create a text file (use something like notepad to make sure that the document is not formatted) and save it as htaccess.txt.
Once you have uploaded the file to your server simply rename the file .htaccess and watch the magic work!
Source: http://dense13.com/blog/2008/02/27/redirecting-non-www-to-www-with-htaccess/
Tags: Google, htaccess, non-www, Search Engine Optomization, www










