Skip to content

Instantly share code, notes, and snippets.

@olkitu
Created March 7, 2019 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olkitu/685e9d1569c85ba1008797351d6fdfbf to your computer and use it in GitHub Desktop.
Save olkitu/685e9d1569c85ba1008797351d6fdfbf to your computer and use it in GitHub Desktop.
Redirect WordPress site to HTTPS exclude Let's Encrypt Webroot directory
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# End WordPress
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment