Skip to content

Instantly share code, notes, and snippets.

@hoangnamitc
Last active November 12, 2021 03:59
Show Gist options
  • Save hoangnamitc/f33d96013e40acfb8f326424d6681c56 to your computer and use it in GitHub Desktop.
Save hoangnamitc/f33d96013e40acfb8f326424d6681c56 to your computer and use it in GitHub Desktop.
(for any site)
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
(with WordPress) - (replace line: "RewriteEngine On")
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
(DONE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment