Skip to content

Instantly share code, notes, and snippets.

@phlegx
Created September 11, 2012 11:52
Show Gist options
  • Save phlegx/3697848 to your computer and use it in GitHub Desktop.
Save phlegx/3697848 to your computer and use it in GitHub Desktop.
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
ServerName vhost.example.com
</VirtualHost>
<VirtualHost *:443>
ServerName vhost.example.com
DocumentRoot /var/www/default/
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment