Skip to content

Instantly share code, notes, and snippets.

@jasperf
Created May 18, 2015 10:58
Show Gist options
  • Save jasperf/3f5628e6698d1f0da6d9 to your computer and use it in GitHub Desktop.
Save jasperf/3f5628e6698d1f0da6d9 to your computer and use it in GitHub Desktop.
.htaccess snippet with WordPress ReWrite Rules + Rule to always use SSL or HTTPS #htacess #ssl
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment