July 16, 2005

102 words 1 min read

mod_rewrite

So I’ve gotten into a kick recently w/ mod_rewrite. It really is very awesome if you’ve never used it. Its extremly handy and not that difficult to use. I also found this handy cheat sheet. I’ve set up two mod_rewrites recenetly. One is forcing all traffic from Snowflakey.com (I’d link but you’d just end up here again) to here. The second is to force all traffic to use the same address (http://snowulf.com). I thought I’d post the code below (note: this code REMOVES all subdomains including www. instead of preprending them):

RewriteEngine On<br /> RewriteCond %{HTTP_HOST} !^snowulf\.com<br /> RewriteRule ^(.*)$ /$1 [R=302,L]