More information about the Underscore mailing list

[_] Non www to www

Leo Pitt leopitt at function-design.co.uk
Fri Dec 18 11:23:38 GMT 2009

Jason Taverner wrote:
> Hi [_]
>
> I've found myself trying to work out why the htaccess file in a  
> clients Drupal installation is not redirecting non www addresses to  
> the www versions.
>
> I've uncommented the lines below from the htaccess file but its not  
> making any difference. Could this be being overridden elsewhere? Am I  
> being a nutmeg?
> RewriteCond %{HTTP_HOST} ^foo.co.uk [NC]
> RewriteRule ^(.*)$ http://www.foo.co.uk/$1 [L,R=301]
> Oh, and a Merry Christmas to one and all!
>
>   

The syntax examples I see for that bit of .htaccess are

RewriteCond %{HTTP_HOST} ^example\.com$ [NC] # Note the backslash in the URL
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

... So could be that you need to add "\"'s to escape the periods in the URL?

-- 

Function Design

19 Portland Square
Bristol
BS2 8SJ

M: 0771 262 2397
W: www.function-design.co.uk