Skip to content

Instantly share code, notes, and snippets.

@antonlindstrom
Created March 8, 2013 12:54
Show Gist options
  • Save antonlindstrom/5116308 to your computer and use it in GitHub Desktop.
Save antonlindstrom/5116308 to your computer and use it in GitHub Desktop.
Rewrites to HTTPS and domain mapping
config_extra => [
'RewriteEngine On',
'RewriteMap domains txt:/etc/apache2/domains.txt',
"RewriteCond %{HTTP_HOST} !${::ipaddress_eth1}|${::fqdn}",
'RewriteRule ^/$ ${domains:%{HTTP_HOST}} [NC,L,R=301]',
'RewriteCond %{HTTPS} off',
'RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC]',
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment