Skip to content

Instantly share code, notes, and snippets.



Created Sep 24, 2015
What would you like to do?
Require https for a specific domain, ignoring other domains that might use the same code base
RewriteEngine on
RewriteBase /
#----- REQUIRE HTTPS for -----
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
You can’t perform that action at this time.