Apache Server configuration support - Redirecting without revealing new destination

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > August 2006 > Redirecting without revealing new destination





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Redirecting without revealing new destination
Harlin

2006-08-19, 1:28 pm

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

Xicheng Jia

2006-08-20, 1:24 am

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/mo...roxypassreverse

Good luck,
Xicheng

Rik

2006-08-20, 7:42 am

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


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com