Skip to content

Instantly share code, notes, and snippets.

@phillip-boombox
Created January 23, 2017 23:28
Show Gist options
  • Save phillip-boombox/34d884ad51a935cf50b39dd56358608d to your computer and use it in GitHub Desktop.
Save phillip-boombox/34d884ad51a935cf50b39dd56358608d to your computer and use it in GitHub Desktop.
Force SSL in .htaccess for WordPress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Force SSL
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment