Please I need some help with Apache 2.4.18. This is the third day fighting with this problem.


  • www.myserver.com: front server for traffic redirection

  • internal server with local ip that contains 2 folders with one web app each one


I want to access these web apps through their subdomains

  • app01.myserver.com and
  • app02.myserver.com

This is my virtualhost configuration file

<VirtualHost *:80>
        ServerName app01.myserver.com
        ProxyRequests Off
        ProxyPreserveHost On
        ProxyPass /
        ProxyPassReverse /

It's working but partially: traffic is being redirected but I'm having problems with links.


After login on app01.myserver.com the browser redirect to app01.myserver.com/dashboard, some links options on the app menu redirect to their respective modules but:

  • when I click app01.myserver.com/profile I'm redirected to app01.myserver.com/profile

  • then I'm redirected to app01.myserver.com/app01/profile

And it correctly gives me a 404 error because "app01/profile" doesn't exist.

I think I need a rewrite rule or the ProxyPass and ProxyPassReverse aren't right. Any help it will be appreciated.


Something like this should work for you:

RewriteEngine On

RewriteRule ^/app01/(.*)  http://app01.myserver.com/$1 [L]
RewriteRule ^/app02/(.*)  http://app02.myserver.com/$1 [L]
  • FTW!!!!! It works like a charm @Rainer! :D No more headache thanks!!!!!! – nerdcoder May 18 '17 at 14:03

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.