Forum Moderators: phranque
[domain.com...] to [bandname.domain.com...]
The mod_rewrite script also exclude or prevent the [webmail.domain.com...] from being rewriten. Here is the script:
ServerAlias *.domain.com
RewriteEngine on
# RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI}!^/viewforum\.php$
RewriteCond %{HTTP_HOST}!^(www¦webmail)\.domain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com
RewriteRule . /viewforum.php?f=%1 [L]
The script worked perfectly, but now I have a problem. I created another subdomain for my site (http://blogs.domain.com) but I dont know how to exclude it from the mod_rewrite script. I tried to modify it but it doesn't work. Here is the modified script
RewriteEngine on
#RewriteMap lowercase int:tolower
ServerAlias *.domain.com
RewriteCond %{REQUEST_URI}!^/viewband.php$
RewriteCond %{HTTP_HOST}!^(www¦webmail).domain.com
RewriteCond %{HTTP_HOST}!^(www¦blogs).domain.com ---> i added this script to exclude blogs.domain.com
RewriteCond %{HTTP_HOST} ^([^.]+).domain.com
RewriteRule . /viewforum.php?f=%1 [L]
It doesn't work as I expected. I can't access the subdomain site and when i browse it, it goes to the [domain.com...] homepage.
Please advise what to do. Please help.
Thank you very much
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/viewforum\.php$
RewriteCond %{HTTP_HOST} !^(www¦webmail¦blogs)\.domain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com
RewriteRule . /viewforum.php?f=%1 [L]
Jim