12/04/2021

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 %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]


2. Restart Apache

systemctl restart httpd

Leave a Reply

Your email address will not be published.