Skip to content

Instantly share code, notes, and snippets.

@axeleroy
Last active March 29, 2018 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save axeleroy/0b4032f862ef63c8b4842f37d97c5433 to your computer and use it in GitHub Desktop.
Save axeleroy/0b4032f862ef63c8b4842f37d97c5433 to your computer and use it in GitHub Desktop.
Force HTTPS on Wordpress sites
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://www.domain.tld/$1 [R,L]
# Replace domain.tld by you own domain name ;-)
# BEGIN WordPress
[...]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment