I have a problem with .htaccess
I have a certificate on my server, and it is only for https://example.com (not https://www.example.com ), so I'm trying to redirect .htaccess to the correct URL.
My intention is this:
http:
http:
https:
I tried different combinations and nothing works. At the moment I have this, but it does not seem to work for
http://www.example.com/subfolderI don't know what is failing ...
RewriteEngine On
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
Options All -Indexes
source
share