I just set up HTTPS on my server, and I have an issue with redirect permanent.
Example: http://example.com/index.html
redirects me to http://www.example.comindex.html
.
The /
(tail ending slash) is missing and I can't figure out how to fix it.
It works with http://www.example.com/index.html
.
Here is my httpd.conf
<VirtualHost *:80>
ServerName example.com
Redirect permanent / https://www.example.com/
</VirtualHost>
<VirtualHost *:80>
ServerName www.domain.com
Redirect permanent / https://www.example.com/
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/example/
ServerName www.example.com
SSLEngine on
SSLCertificateFile ssl.crt
SSLCertificateKeyFile ssl.key
</VirtualHost>
RedirectMatch
instead:RedirectMatch 301 ^(.*)$ https://www.domain.com$1
-- see if it makes the difference. Also -- modern browsers do cache permanent redirects, so if it failed first time, then browser may still be using old redirect. I suggest clear browser cache and restart it (and/or try another browser).