I recently configured by website to direct all traffic through https. I did this by modifying the vhost file to show this
<VirtualHost *:80>
DocumentRoot "/srv/http/example"
ServerName example.com
Redirect permanent / https://example.com/
</VirtualHost>
This works fine when I go to the root of the site i.e. example.com, however when I try to go to a subdirectory I get a weird break in the url. For example if I type example.com/blog it tries to redirect to https://example.comblog. What is going on here?
Redirect
line becomeRedirect permanent / https://example.com
(e.g without trailing slash). With your configuration above, the redirection works properly.RedirectMatch permanent ^/(.*)$ https:/example.com/$1
and neither worked.