Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Friday, November 12, 2021

How to redirect http requests to https?


Add the following lines to the /etc/apache2/sites-enabled/000-default.conf file in side <VirtualHost *:80> </VirtualHost> block (In debian based linux)

RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}