httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manohar N Ellanti" <>
Subject [users@httpd] url rewrite
Date Thu, 19 Aug 2004 16:01:19 GMT
Can some one help clarify if this is feasible

Using url to file rewrite/mapping:

in  /subdomain-a/.htaccess:

Rewriterule ^(.*)$     /www/shared/$1 [E=SUBDOMAIN:A]

in  /subdomain-b/.htaccess
Rewriterule ^(.*)$     /www/shared/$1 [E=SUBDOMAIN:B]

Using url to url rewrite/mapping (supposed to be available in Apache

in /subdomain-a/.htaccess:

Rewriterule ^(.*)$     http:/$1

in /subdomain-b/.htaccess
Rewriterule ^(.*)$     http:/$1

Though I tried both - I could not access the env variable from the PHP

But, I think a more elegant solution may be setting the original uri
request information in a variable that is accessible to scripts like
PHP. For instance,  SCRIPT_URL or SCRIPT_URI or a new variable something
like - URL_BEFORE_REWRITE. This would allow application script engines
(perl, php, jsp/servlets)  to know the subdomain and accordingly alter
the content being served. 

Another requirement if some one can show me how to do if possible
After rewrite - the client browser should still show in the address bar
the original path - for instance //
instead of //www.maindomain/shared/xxxx -  



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message