Skip to content

Instantly share code, notes, and snippets.

@ewingson
Created December 7, 2018 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewingson/ecc55f01c139d98037da4c58a6095229 to your computer and use it in GitHub Desktop.
Save ewingson/ecc55f01c139d98037da4c58a6095229 to your computer and use it in GitHub Desktop.
htaccess_rewrite_condition_force_nonwww_force_https_!
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.blahblah.com/$1 [R,L]
RewriteCond %{HTTP_HOST} ^www\.blahblah\.com [NC]
RewriteRule ^(.*)$ https://blahblah.com/$1 [L,R=301]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment