Skip to content

Instantly share code, notes, and snippets.

@lyquix-owner
Last active February 13, 2017 20:33
Show Gist options
  • Save lyquix-owner/48ec9523b6c1c3a1acd0e5fd71071bec to your computer and use it in GitHub Desktop.
Save lyquix-owner/48ec9523b6c1c3a1acd0e5fd71071bec to your computer and use it in GitHub Desktop.
Redirect domain to www and force SSL
# Redirect domain to www and force SSL #
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.example.com$ [OR,NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment