I have my .htacces
on my server and it looks like so:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
But when I type example.com
in my browser it doesn't redirect to https://example.com
. How can I do that?
It would seem it was just the spelling of .htaccess
(filename) that was the problem. This has two s
, not one, as stated in the question.
Bit of an aside... the name of this file (per-directory Apache config filename) can be changed in the server config (although this is rare):
AccessFileName .htaccess