Is it possible to configure Apache web server to map a directory to a path on another web server? For example, can I make requests for http://server1/resource/ return http://server2/resource/. If this is possible, how do I go about setting this up?
mod_proxy is the way to go
Use:
<Location /resource/>
ProxyPass http://server2/resource/
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
</Location>
mod_rewrite is pretty powerful for this. You'd setup a rewrite rule for /resource/ and use a 302 redirect to send people over to server two.
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
http://www.modrewrite.com/
Untested example:
<location "/">
RewriteEngine On
RewriteRule ^/resource/(.*)$ http://server2/resource/$1 [R]
</location>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With