Closed fulldecent closed 7 years ago
RewriteEngine On
# https://www.drupal.org/node/2645198
RewriteRule "^.well-known/acme-challenge" - [L]
# HTTP -> HTTPS
# https://stackoverflow.com/a/4399158/300224
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Redirect www.domain.com -> domain.com
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Done, this is here https://github.com/fulldecent/html-website-template/wiki/How-to-set-up-HTTPS
Linked from README.md
Add an .htaccess file that works with Apache and includes instructions for LiteSpeed server, which redirects http to https.