This is the situation:

Server A hosts "http://internal.intranet"

Server B hosts the internal application on "http://servernameb.intranet/foo/bar"

Server A needs to redirect all incoming http trafic to the adress of server B without users noticing it.

I can easly do this with the following config file:

  ServerName internal.intranet
  ServerAlias internal

  RewriteEngine on

  # Deny TRACE/TRACK request methods
  RewriteRule .* - [F]

  #RewriteRule "^/files(.*)$" "/files$1" [L]

  # Everything else not matched above needs to go to the servlet container
  # via HTTP listening on port 8008. The [P] flag (which is required)
  # implies that our requests will be handled by mod_proxy.
  RewriteRule "^/(.*)" "http://servernameb.intranet:8080/foo/bar/$1" [P]

But then the problem is that the url shown in the users browser is: http://servernameb.intranet..... instead of http://internal.intranet

I don't want the users to get in contact with the servernameb address.

I know I probably need to use ProxyPass and ProxyPassReverse but i just can't get it to work.


you should try the following:

  ServerName internal.intranet
  ServerAlias internal

  ProxyPass        /  http://servernameb.intranet/foo/bar/
  ProxyPassReverse /  http://servernameb.intranet/foo/bar/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.