Forum Moderators: phranque
[subdomain.domain.tld...] -> index.php?subdomain=subdomain
[subdomain.domain.tld...] ->
index.php?subdomain=subdomain&page=page
I am using the following htaccess, but it doesn't work! Someone can help me?
rewriteCond %{HTTP_HOST} !^www\. [NC]
rewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com(:80)?$
rewriteRule (.*) index.php?subdomain=%1&page=$1 [L]
[edited by: Ruben at 2:07 pm (utc) on Feb. 14, 2008]
If it's in .htaccess, then you'll have to explicitly prevent an "infinite" rewriting loop:
RewriteCond $1 !index\.php$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com(:80)?$
RewriteRule (.*) index.php?subdomain=%1&page=$1 [L]