Redirecting your to

April 19th, 2010

With people taking steps to make their website search engine friendly, there are some basic things which can be done to get on the better side of Google. Redirecting non www domains to www domains avoids the issue of duplicate content being indexed on search engines.

Below is the code which you need to put in your .htaccess which will redirect any user who types in to

RewriteEngine on

RewriteCond %{HTTP_HOST} ^
RewriteRule (.*)$1 [R=301,L]

Please change to your website url.


  1. Siraj August 16th, 2010


    Can this be done on wordpress Blog as well?

    What is the benefit of doing it?



  2. Prashant August 16th, 2010

    Yes, this is automatically done by WP when your specify your URL in Settings. The benefit of doing this is that it eliminates the chances of duplicate content issue with search engines.

  3. Making your PHP code work within files with extension .html December 1st, 2010

    […] Related Articles: 1. Redirecting your non www to using .htaccess […]

  4. enter now December 7th, 2013

    Superb, what a website it is! This web site provides valuable data to us, keep it up.

Leave A Comment