Skip to content

Instantly share code, notes, and snippets.

@bobmaerten
Created February 24, 2014 15:31
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 bobmaerten/9190472 to your computer and use it in GitHub Desktop.
Save bobmaerten/9190472 to your computer and use it in GitHub Desktop.
Redirection :80 -> :443
<VirtualHost *:80>
ServerName plop
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName plop
SSLCertificateFile /etc/apache2/ssl/plop.pem
SSLCertificateKeyFile /etc/apache2/ssl/plop.key
ErrorLog /var/log/apache2/plop-error.log
LogLevel warn
CustomLog /var/log/apache2/plop.log combined
ServerSignature Off
DocumentRoot /var/www/plop
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment