ServerName www.example.com ServerAlias www ServerAdmin webmaster@example.com DocumentRoot /home/webmaster/public_websites/www.example.com/ ErrorLog ${APACHE_LOG_DIR}/www.example.com-error.log CustomLog ${APACHE_LOG_DIR}/www.example.com-access.log combined ServerName example.com ServerAlias *.www.example.com RewriteEngine On RewriteRule / http://www.example.com/ [R] # RewriteRule /(.*) http://www.example.com/$1 [R] CustomLog ${APACHE_LOG_DIR}/redirect.log vhost_combined ServerName www.example.com:443 ServerName *.example.com:443 ServerName www:443 ServerName *.www:443 Include conf-available/local-tls.conf RewriteEngine On RewriteRule / http://www.example.com/ [R] # RewriteRule /(.*) http://www.example.com/$1 [R] CustomLog ${APACHE_LOG_DIR}/redirect.log vhost_combined