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

8,755

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"
Share:
8,755

Related videos on Youtube

kmeyers
Author by

kmeyers

Updated on September 18, 2022

Comments

  • kmeyers
    kmeyers over 1 year

    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