Skip to content

Instantly share code, notes, and snippets.

@dbridgman
Created April 14, 2016 09:49
Show Gist options
  • Save dbridgman/50d375117f915536cd3da1fafabc37d7 to your computer and use it in GitHub Desktop.
Save dbridgman/50d375117f915536cd3da1fafabc37d7 to your computer and use it in GitHub Desktop.
Ensure this is placed at the top of the .htaccess file.
####################
###HTTPS REDIRECT###
####################
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
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