jb,
With Dynamic Mass Hosting (as Apache.org calls it), it would be a snap (so long as ABSOLUTE links are used within the subdomain scripts - if any) - but I would POINT all subdomains at the main domain's DocumentRoot and not use the absolute redirect. The subdomain redirection you've suggested would be simple:
Code:
# don't redirect the redirect!
RewriteCond %{QUERY_STRING} !subdomain=
# capture the subdomain
RewriteCond %{HTTP_HOST} ^([a-z]+)\.domain\.com [NC]
# but not www.
RewriteCond %{HTTP_HOST} !^(www\.)domain\.com [NC]
# then redirect anything to the index script
# with the subdomain in the query string
RewriteRule .? index.php?subdomain=%1 [QSA,L]
Regards,
DK
Bookmarks