-
mod_rewrite
Code:
RewriteRule http://snowy-day.net http://www.snowy-day.net/ [R=301]
RewriteRule http://snowy-day.net/(.*)? http://www.snowy-day.net/($1) [R=301]
My goal is to force the www. on all URLs on my site and the trailing slash on the domain level. This is obviously not a good way to do it, nor a correct one, as it doesn't work. What do I do instead?
More questions to follow at some point if I get to the point where I have some terribly ugly php-made urls.
-
I'd probably use some If Statements pulled in with a PHPInclude that force each page to check and alter the url?
-
Jason showed me the light:
Code:
RewriteCond %{HTTP_HOST} ^snowy-day.net [NC]
RewriteRule ^(.*)$ http://www.snowy-day.net/$1 [R=301]