This question already has an answer here:
- Redirecting from http to https in Apache 2 answers
I've following VirtualHost configured:
<VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/mysite.com/public_html/ ServerName www.mysite.com ServerAlias mysite.com <Directory "/var/www/mysite.com/public_html"> #Options FollowSymLinks #AllowOverride All #Order allow,deny #Allow from all Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory>
- to enforce a https-only connection
- and allow a connection when the user uses mysite.com without www
How to do that?