Apache: Add a prefix to all URLs in a virtualhost

apache-2.2mod-proxymod-rewrite

In one of my machines I have an internal server which listens at port 8090. I am using a virtualhost in Apache to proxy the internal server using a URL like servera.mydomain.com:

<VirtualHost *:443>
    ServerAlias servera.mydomain.com

    ProxyPass         /     http://localhost:8090/ nocanon
    ProxyPassReverse  /     http://localhost:8090/
   ...
</VirtualHost>

This works well, and when I open https://servera.mydomain.com from my browser it redirects me to http://localhost:8090/.

The problem is that all the urls in the server begin with ReportServer, and therefor I actually have to type https://servera.mydomain.com/ReportServer in order to access it, which is cumbersome.

I have tried:

    RewriteEngine on
    RewriteRule ^(.*)$ ReportServer/$1

But I only get 404 errors without good explanation in the logs.

What's the proper way to put a ReportServer prefix in all URLs in the virtualhost? Can I choose whether the prefix will be visible to the browser or not?

Best Answer

Try

ProxyPass         /     http://localhost:8090/ReportServer nocanon
ProxyPassReverse  /     http://localhost:8090/ReportServer
Related Topic