Forum Moderators: phranque
mod_rewrite to redirect people accessing a subdomain to view another subdomain (transparently) RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.+)\.domain\.com
RewriteRule ^(.*)$ http://test.domain.com/$1?sub=%1 [P]
http://anotherone.domain.com/login.php the URL in the address bar will not change but http://test.domain.com/login.php will be loaded. echo $_SERVER['HTTP_HOST'];
echo $_SERVER['SERVER_NAME'];
test.domain.com and I'm trying to get anotherone.domain.com When users go tothe URL in the address bar will not change buthttp://anotherone.domain.com/login.phpwill be loaded.http://test.domain.com/login.php
anotherone.domain.com
X-FORWARDED-____ headers, and you'll need to configure both servers to detect and/or set these. [edited by: g1smd at 7:42 pm (utc) on Sep 16, 2012]
it's a Proxy pass-through
proxy [P] Force the substitution URL to be internally sent as a proxy request.
passthrough [PT] Forces the resulting URI to be passed back to the URL mapping engine for processing of other URI-to-filename translators, such as Alias or Redirect. Since this is all the same base hostname you should probably be looking to use internal rewrites for this, and then the information you want will be more readily available.
do you have mod_proxy enabled?