Forum Moderators: phranque
RewriteCond %{HTTP_HOST} (groups)\.example\.com
RewriteRule (.*) page.php?var=$0
$0 is only returning page.php. This will only output page.php. But I want users to type in:
groups.example.com/mygroup
so that $0 is page.php?var=mygroup and $1 is just mygroup
I tried putting the extra () in the RewriteCond but didn't have luck.
[edited by: jdMorgan at 7:32 pm (utc) on Oct. 22, 2007]
[edit reason] example.com [/edit]
The parentheses in your RewriteCond are unnecessary, unless you use the %1 back-reference, or wish to make the subdomain "groups" optional by following the parentheses with a "?". I this latter case, the pattern should read "(groups\.)?example.com".
If that is not part of your purpose, then I'd suggest:
RewriteCond %{HTTP_HOST} ^groups\.example\.com
RewriteCond $1 !^page\.php$
RewriteRule (.*) page.php?var=$1
Jim