Skip to content

Instantly share code, notes, and snippets.

@Remiii
Created February 26, 2019 12:57
Show Gist options
  • Save Remiii/d615151ba801442d88b91fa20cce8042 to your computer and use it in GitHub Desktop.
Save Remiii/d615151ba801442d88b91fa20cce8042 to your computer and use it in GitHub Desktop.
Force your site to load securely with an .htaccess file

Force your site to load securely with an .htaccess file

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# 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

Source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment