0

I want to redirect a url from http to https but if the url doesn't have traillin slash it won't be redirect. I tried many way as I'm noobie in Apache I haven't done it. this is the config:

<VirtualHost *:80>
    ServerName mydomain.nl
    ServerAlias www.mydomain.nl
    ProxyPass / http://127.0.0.1:3001/
    ProxyPassReverse /  http:127.0.0.1:3001/
    ProxyPreserveHost On
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    Redirect permanent / https://mydomain.nl
</VirtualHost>
Kourosh
  • 917
  • 1
  • 11
  • 24

1 Answers1

0

You can use the ProxyPassMatch directive instead of ProxyPass. It allows using regular expression for matching urls. For example:

ProxyPass (^.*[^\/]?$) http://127.0.0.1:3001/

The url should match if it contains no characters or it contains characters and does not end with "/"

Nadir Latif
  • 3,690
  • 1
  • 15
  • 24