I have a mod rewrite that currently redirects
domain.com/folder/user
to
domain.com/folder.php?username=user
using:
RewriteRule ^folder/(.+)$ folder.php?username=$1 [QSA,L]
What I need done however is redirect http://user.domain.com/ to http://www.domain.com/folder.php?username=user . And if possible, I could exclude certain subdomains (like www. mail., etc. from being forwarded).
How would I do this? Any help is GREATLY appreciated 🙂
How it works:
userfromhttp://user.domain.com/and save a backreference to it with aRewriteCondition.The hostname of the request is stored in a Server-Variable.
In the
RewriteRuleuse theRewriteCondition‘s backreference.RewriteRulesection: