Posted By

mattkenefick on 08/24/10


Tagged

htaccess apache www force


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

mattkenefick
kubaitis
mike_fowler
tribal
banjomamo


Force WWW


 / Published in: Apache
 

It's great because it's a drop-in code that doesn't require domain alteration. Works really well with any server too (some servers fail with other methods).

  1. RewriteCond %{HTTP_HOST} !^www\.
  2. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Report this snippet  

You need to login to post a comment.