Skip to content

Instantly share code, notes, and snippets.

@brunocmoraes
Created February 10, 2020 19:20
Show Gist options
  • Save brunocmoraes/7b6cbc8f86604ad74db192b3045e2528 to your computer and use it in GitHub Desktop.
Save brunocmoraes/7b6cbc8f86604ad74db192b3045e2528 to your computer and use it in GitHub Desktop.
Generic redirect from http to htaccess (without set domain)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment