virtual host http apache localhost redirecting to https code example
Example 1: redirect http to https all domains vhost
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
Example 2: redirect http to https apache2 ubuntu 20.04
HTTP Redirection