08/08/2020

Apache Rewrite HTTP to HTTPS on CentOS 8

Rewrite HTTP to HTTPS

1. Edit vhost to add the following lines to it:

RewriteEngine On
RewriteCond {9e5307db134b9302becb6f095c21bec46d8edb9a0fab4b8483fa01086cb93aae}{HTTPS} off
RewriteRule (.*) https://{9e5307db134b9302becb6f095c21bec46d8edb9a0fab4b8483fa01086cb93aae}{SERVER_NAME}/$1 [R,L]


2. Restart Apache

systemctl restart httpd

Leave a Reply

Your email address will not be published.