Skip to content

Instantly share code, notes, and snippets.

@gtrias
Created July 28, 2015 10:57
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 gtrias/f49902025f44b30e0176 to your computer and use it in GitHub Desktop.
Save gtrias/f49902025f44b30e0176 to your computer and use it in GitHub Desktop.
Apache redirect to HTTPS
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.example.com
Redirect permanent / https://secure.example.com/
</VirtualHost>
<VirtualHost _default_:443>
ServerName secure.example.com
DocumentRoot /usr/local/apache2/htdocs
SSLEngine On
# etc...
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment