Apache virtual host basic template
September 25, 2018•69 words
This is where I start when I have to configure an Apache server: a simple virtual host template with ssl rewrite.
<VirtualHost *:80>
ServerName my.domain.com
ServerAlias my.domain.com
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{SERVER_NAME}$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "/path/to/htdocs"
ServerName my.domain.com
ServerAlias my.domain.com
SSLEngine on
SSLCertificateFile /path/to/s...
Read post