Skip to content

Instantly share code, notes, and snippets.

@fernandiez
Created April 23, 2017 23:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fernandiez/0684a5bea38fb60373a5b132ef86bb21 to your computer and use it in GitHub Desktop.
Save fernandiez/0684a5bea38fb60373a5b132ef86bb21 to your computer and use it in GitHub Desktop.
Redirect 301 from HTTP to HTTPS with www
#Redirect 301 from HTTP to HTTPS with www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment