Skip to content

Instantly share code, notes, and snippets.

@JayOkey
Created May 27, 2018 11:08
Show Gist options
  • Save JayOkey/ecc0a21aadbd17fecb782b75c781752e to your computer and use it in GitHub Desktop.
Save JayOkey/ecc0a21aadbd17fecb782b75c781752e to your computer and use it in GitHub Desktop.
A WordPress .htaccess file that redirects http requests to https
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
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