www or not - use one or the other?

Discussion in 'Search Engine Optimization' started by Chris369, Feb 26, 2007.

  1. #1
    I've been reading about this and it seems to be the case that it doesn't matter which one you choose, as long as you are consistent and use the same one each time.

    Now if there are already a lot of links out there and they are mixed between www and not, the best thing to do is redirect one URL to the other.

    I found some code to put in a htaccess file which does this for you :)

    
    RewriteEngine on
    rewritecond %{http_host} ^domain.com [nc]
    rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
    Code (markup):
    Stick that in a .htaccess file in the root directory and a non www url will be redirected to the www version. I am not sure how to do it the other way round so if someone would like to help then go ahead :)
     
    Chris369, Feb 26, 2007 IP