[thelist] .htaccess mod_rewrite

Tim Burgan email at timburgan.com
Wed Dec 14 02:38:07 CST 2005


Hello


I'm trying to have http://example.com rewritten to 
http://www.example.com, and http://example.com/anything/ rewritten to 
http://www.example.com/anything/

I have the first case working fine, but as soon as a directory is added 
to the URL, it dies.

Also, is it possible to put .htaccess in the root of the site, and have 
it's setting applied to all sub-directories of the root, so I don't have 
to re-create the same .htaccess and put it in every directory?


Here's my .htaccess:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.example.com [NC]
RewriteRule ^/?(.*) http://www.example.com/$1 [R=permanent,L]


Thanks

Tim




More information about the thelist mailing list