Sunday, February 28, 2021

How to http 301 URL redirection to https(SSL) with httpd-vhosts.conf ? (AWS Lightsail,LAMP,wordpress)

How http 301 URL redirection to https(SSL)  with httpd-vhosts.conf ? 


This environment is  AWS Lightsail ,LAMP,and more website with apache virtual host


/opt/bitnami/apache/conf/extra



listen 80 and 443 port


add 

    RewriteEngine On

    RewriteCond %{HTTPS} off

    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]



PS.If use before code and start http/2 ,Maybe  redirection have  problem.
So fix code 






No comments:

Post a Comment