Forum Moderators: phranque
[edited by: jdMorgan at 3:52 am (utc) on Jan. 11, 2005]
[edit reason] Examplified. Please see TOS. [/edit]
I believe I have a solution for you.
You need wildcards in your DNS. (*.domain.tld)
You need this in your .htaccess file:
RewriteEngine On
# Prevent infinite loops. The NC flag means case-insensitive
RewriteCond %{REQUEST_URI} !/forums/index\.php [NC]
# HTTP_HOST should not be empty
RewriteCond %{HTTP_HOST} .
# HTTP_HOST should not start with www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
# Take whatever is in front of .example.com and use parantheses, so it becomes a variable (%1).
RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^([^.]+)\.infoxyris\.com(:80)?/.* [NC]
# use the variable and rewrite. Flags are: Last (rule), Query String Appending
RewriteRule .* /forums/index\.php?name=%1 [L,QSA] Give it a try. As far as I can see at the moment, this should work like a dream :)
[edited by: jdMorgan at 3:55 am (utc) on Jan. 11, 2005]
[edit reason] Examplified domain. [/edit]
..or perhaps that wasn't the problem you were refering to?