Home   |   About Us   |   List Of Directory   |   Bookmarking List   |   SEO Resources   |   Contact

Aug 19, 2011

How to fix url with or without www

A URL of a website can be written with or without "www," like this:

* http://www.test.com, OR
* http://test.com

However for general visitor the URLs with and without "www" does not make any problem but Some search engines see the above two URLs as two different URLs and may provide a different PageRank and if without fixing you use both, you're diluting the PR for each URL.

It is advisable to choose one out of above versions for SEO purpose to get good PR and link juice.

How to redirect from one to the other using .htaccess

Make changes in your .htaccess file and replace "test.com" with your domain.

To redirect to the URL with www

RewriteEngine On
rewriteCond %{HTTP_HOST} ^test.com [NC]
rewriteRule ^(.*)$ http://www.test.com/$1 [R=301,L]