Skip to content

Instantly share code, notes, and snippets.

@christierney402
Created September 24, 2015 20:26
Show Gist options
  • Save christierney402/e0c099f2a36942c71811 to your computer and use it in GitHub Desktop.
Save christierney402/e0c099f2a36942c71811 to your computer and use it in GitHub Desktop.
Require https for a specific domain, ignoring other domains that might use the same code base
RewriteEngine on
RewriteBase /
#----- REQUIRE HTTPS for www.mysite.com -----
RewriteCond %{HTTP_HOST} ^www\.mysite\.com [NC]
RewriteCond %{HTTPS} !on
RewriteRule ^/?(.*) https://%{HTTP_HOST}%{REQUEST_URI} [R]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment