httpd-users mailing list archives

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

subdomain-a.maindomain.com
subdomain-b.maindomain.com

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
2.0)

in /subdomain-a/.htaccess:

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

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

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

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
already- 
After rewrite - the client browser should still show in the address bar
the original path - for instance //subdomain-a.maindomain.com/xxxx
instead of //www.maindomain/shared/xxxx -  

-ellanti

 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message