TriggerHappy
...
- Reaction score
- 341
I need some help on making an htaccess file which does something like this;
www.sub.mysite.com/file.php
redirects to
www.mysite.com/file.php?var=sub
It needs to be dynamic so it works with any file in the directory and any subdomain.
It also needs to mask the domain, so in the header it would look like sub.mysite.com/file.php still.
Think of it in terms like this;
$1 = the file
$2 = subdomain
www.$2.mysite.com/$1
redirects to
www.mysite.com/$1?var=$2
www.sub.mysite.com/file.php
redirects to
www.mysite.com/file.php?var=sub
It needs to be dynamic so it works with any file in the directory and any subdomain.
It also needs to mask the domain, so in the header it would look like sub.mysite.com/file.php still.
Think of it in terms like this;
$1 = the file
$2 = subdomain
www.$2.mysite.com/$1
redirects to
www.mysite.com/$1?var=$2