This is a discussion on Redirecting without revealing new destination within the Apache Web Server forums, part of the Web Server and Related Forums category; I have traffic coming into one box. I then have rewrite rules set up to route them to different servers. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I have traffic coming into one box. I then have rewrite rules set up to
route them to different servers. An example: RewriteEngine On RewriteCond %{HTTP_HOST} ^gwtest.bobo.com$ [NC] RewriteRule ^(.*)$ http://podweb1.bobo.com$1 [R,L] By the way the url in the Rule is on a different physical server than the one sending it. What I'd like to do is to be able to send it there but still keeping the original referring URL affixed to the URL. This way when it does go to http://podweb1.bobo.com/mp3s, the url instead will say http://gwtest.bobo.com/mp3s. Is there any way to get this accomplished using Apache? Regards, Harlin Seritt |
|
|||
|
Harlin wrote:
> I have traffic coming into one box. I then have rewrite rules set up to > route them to different servers. An example: > > RewriteEngine On > RewriteCond %{HTTP_HOST} ^gwtest.bobo.com$ [NC] > RewriteRule ^(.*)$ http://podweb1.bobo.com$1 [R,L] > > By the way the url in the Rule is on a different physical server than > the one sending it. What I'd like to do is to be able to send it there > but still keeping the original referring URL affixed to the URL. This > way when it does go to http://podweb1.bobo.com/mp3s, the url instead > will say http://gwtest.bobo.com/mp3s. Is there any way to get this > accomplished using Apache? You may want to set up a Reverse Proxy, and especially check "ProxyPassReverse" directive. http://httpd.apache.org/docs/2.0/mod...oxypassreverse Good luck, Xicheng |
|
|||
|
Harlin wrote:
> I have traffic coming into one box. I then have rewrite rules set up > to route them to different servers. An example: > > RewriteEngine On > RewriteCond %{HTTP_HOST} ^gwtest.bobo.com$ [NC] > RewriteRule ^(.*)$ http://podweb1.bobo.com$1 [R,L] > > By the way the url in the Rule is on a different physical server than > the one sending it. What I'd like to do is to be able to send it there > but still keeping the original referring URL affixed to the URL. This > way when it does go to http://podweb1.bobo.com/mp3s, the url instead > will say http://gwtest.bobo.com/mp3s. Is there any way to get this > accomplished using Apache? From: http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html 'proxy|P' (force proxy) This flag forces the substitution part to be internally forced as a proxy request and immediately (i.e., rewriting rule processing stops here) put through the proxy module. You have to make sure that the substitution string is a valid URI (e.g., typically starting with http://hostname) which can be handled by the Apache proxy module. If not you get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map some remote stuff into the namespace of the local server. Notice: To use this functionality make sure you have the proxy module compiled into your Apache server program. If you don't know please check whether mod_proxy.c is part of the ``httpd -l'' output. If yes, this functionality is available to mod_rewrite. If not, then you first have to rebuild the ``httpd'' program with mod_proxy enabled. http://httpd.apache.org/docs/1.3/mod/mod_proxy.html Grtz, -- Rik Wasmus |