skip to Main Content

How to Redirect HTTP to HTTPS on Apache?

Environment: Ubuntu with Apache. Trying to setup automatic redirection from http to https. I have tried: <VirtualHost *:80> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> <VirtualHost *:443> SSLEngine on SSLCertificateFile <path to your crt file> SSLCertificateKeyFile <path to…

VIEW QUESTION
Back To Top
Search