httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Severin Gehwolf <Severin.Gehw...@uibk.ac.at>
Subject Re: [users@httpd] URL redirection
Date Thu, 20 Dec 2007 09:56:16 GMT
Hi!

> Could you please advise if this can be done in apache?
> http://server1/OpenObject?doc=ERW
> to be redirected to:
> http://server2:9000/OpenObject?doc=ERW
> I mean everything that starts with /OpenObject to be
> redirected to server2:9000 with the same trailing
> string /OpenObject?doc=ERW or /OpenObject?doc=ERW1
> …etc.

In your httpd configuration of "server1" put the following (have
mod_rewrite, mod_proxy and mod_proxy_http loaded). I assume you would
like to have it transparent for the user. Therefore I suggest proxying
the requests like so:

RewriteEngine On
RewriteRule ^/(OpenObject.*) http://server2:9000/$1 [P,L]
ProxyPassReverse / http://server1/

or just by permanent (cachable) redirect (no mod_proxy needed):

RewriteEngine On
RewriteRule ^/(OpenObject.*) http://server2:9000/$1 [R=301,L]

---
severin


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