Entry
How do I redirect specific URL's to an internal IP address
Jul 30th, 2002 13:53
Jack Nerad, Duncan Morgan, http://httpd.apache.org/docs/mod/mod_alias.html#redirect http://httpd.apache.org/docs/mod/mod_proxy.html#proxypass
Let's say that you have a server with a url (http://my.server/url) that
you want to redirect to an internal IP address
(http://internal.ip.address).
You can use the "Redirect" run-time directive to accomplish this. To do
this you add to your httpd.conf file:
Redirect permanent /url http://internal.ip.address
The internal ip address does not have to be an internal one, though. If
it is internal, only those on the internal subnet will have access to
http://internal.ip.address.
It is also possible to have a more transparent effect by using the proxy
module. A proxy acts as a go-between for the user and the other ip
address, so there is no redirection involved. It would mean that
anybody outside the internal network could also see the documents on the
internal ip address.
To do this, you have to have a machine with network interfaces on both
the internal network and the external network (beyond the scope of this
faq). To set up the proxy, make sure that mod_proxy is compiled into
your Apache installation, and then add the following directives to your
httpd.conf file.
ProxyPass /url http://internal.ip.address
ProxyPassReverse /url http://internal.ip.address
Supposing our server name is http://my.server, the above lines will
cause a request for http://my.server/url/internal to return the document
found at http://internal.ip.address/internal.