I am using this directive to redirect to HTTPS
:
<VirtualHost *:80>
ServerName foo.bananas.net
Redirect 301 / https://foo.bananas.net
</VirtualHost>
The problem is that when a path is used in the address bar, like http://bananas.net/webpage
, it takes a pauses for a while before failing with https://bananas.netwebpage
(no slash).
Should a rewrite rule be used instead? What should it be, and are there any differences in behaviour that I should be aware of?
You could use mod_rewrite, or you could use a RedirectMatch.
e.g. something like this:
on second thoughts, just add a "/" to the end of the Redirect rule you already have:
either should work.