Skip to content

Instantly share code, notes, and snippets.

@MarioLiebisch
Created November 10, 2015 18:49
Show Gist options
  • Save MarioLiebisch/3ee8637fc60dd9c1cca1 to your computer and use it in GitHub Desktop.
Save MarioLiebisch/3ee8637fc60dd9c1cca1 to your computer and use it in GitHub Desktop.
Redirect all http traffic to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/https/
RewriteCond %{SCRIPT_NAME} !^/https/
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment