Force https
Section 9 deals with forcing HTTPS. Assuming an SSL certificate is installed, it is strongly recommended that https be enabled as it is now a best practice, even on sites that don't handle sensitive data.
To force HTTPS, uncomment section 9a:
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Note: if using certbot for SSL, the certbot tool may have already https in the relevant Apache configuration file, therefore this step may be unnecessary, but still recommended.
- Episode #
- 3 of 7
- Course
- .htaccess File