I have edited my .htaccess file to divert:
something.domain.com => domain.com/hosted/something
with the exception of
www.domain.com.
Before I had this in place, I had a rule which would rewrite (for example)
domain.com/contact-us => domain.com/page.php?url=contact-us and show domain.com/contact-us
Now what I need is when I'm on "something.domain.com/contact-us" (for example), it to go to "domain.com/hosted/something/page.php?url=contact-us" and to show "something.domain.com/contact-us"
My current htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com
RewriteRule ^$ /hosted/%1 [L]
##### Do not process admin area #####
RewriteRule ^admin/?.*$ - [PT,L]
##### General redirect #####
RewriteRule ^([^/\.]+)/?$ page.php?url=$1 [QSA]