-1

I've got a domain like domain.com and a path in it like /path so that domain.com/path redirects to another server entirely (let's say 128.10.10.10).

This works, but I'd like to set it up so when I'm at 128.10.10.10 after the redirect the URL bar at the top of the browser reads domain.com/path and so that any subfolders therein would be accessible via domain.com/path/subfolders.

Any idea how to do this? The server (128.10.10.10) is running Apache and CentOS.

Thanks!

t56k
  • 115
  • 5

1 Answers1

2

For that, you'll want a reverse proxy:

ProxyPass /path/ http://128.10.10.10/
ProxyPassReverse /path/ http://128.10.10.10/

When you do this, you'll no longer redirect traffic to 128.10.10.10. Traffic will flow through domain.com to 128.10.10.10. The 128.10.10.10 web process will see the traffic coming from domain.com, not from the end-user.

You can read more details at Apache's mod_proxy documentation.

hrunting
  • 953
  • 4
  • 7
  • So I don't need to change my `` block? I just throw those details in `httpd.conf` somewhere? – t56k Feb 05 '13 at 04:24
  • You'll need to put the `ProxyPass` and `ProxyPassReverse` configurations in the `domain.com` configurations, not the `128.10.10.10` configurations. – hrunting Feb 05 '13 at 04:37
  • Ah, that makes much more sense. Cheers. – t56k Feb 05 '13 at 04:39