I setup wildcard DNS.. so that anything.domain.com will basically be domain.com
What I want to do is setup mod rewrite so (.*).domain.com will be domain.com/?id=$1
Anyone know how I would set the rewrite rule for the sub domain?
Thanks!
Mod rewrite sub domains
Moderator: General Moderators
Got it figured out... here is the code for anyone interested
Code: Select all
RewriteEngine on
ReWriteCond %{HTTP_HOST} !^$
ReWriteCond %{HTTP_HOST} !www\.domain\.com
ReWriteCond %{HTTP_HOST} (.*)\.domain\.com
ReWriteRule (.*) dir/index.php?id=%1 [QSA]