Apache Virtual Hosts .. Redirect .. ProxyPass .. and Alias

apache-2.2apache-2.4proxypass

I have tried just about everything and am looking for help the with below… We are currently doing a Redirect with a Proxypass, however I would like to create a alias and point everyone there instead of the Proxypass.

Currently when you go to server.org it redirects to -> server.org/test/ which is proxy'd -> localhost:8080/test/

I would like to create an alias /mm so that either server.org/mm/ or server.org/test/mm/ will be redirected to the alias provided.

Is this possible?

I have tried (ProxyPass /mm !) with no luck

Thanks in advance!

DocumentRoot "/var/www/html"
Redirect "/" "https://server.org/test/" 

Alias /mm "/var/opt/mm"

<Directory "/var/opt/mm">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass /test/ http://localhost:8080/test/
ProxyPreserveHost On
ProxyStatus On        

Best Answer

This should works:

DocumentRoot /var/www/html
Redirect (!/mm) https://server.org/test/

Alias /mm "/var/opt/mm"
Alias /test/mm "/var/opt/mm"

<Directory "/var/opt/mm">
    Options Indexes FollowSymLinks
    AllowOverride All
</Directory>

ProxyRequests Off
ProxyPreserveHost On
ProxyStatus On  

ProxyPass /test/mm !
ProxyPass /test/ http://localhost:8080/test/

if you are sure /mm is unique in the url you can change

Alias /mm "/var/opt/mm"
Alias /test/mm "/var/opt/mm"

by

AliasMatch /mm "/var/opt/mm"
Related Topic