Redirect HTTP request to HTTPS

To redirect http requests to https on your Apache web server use .htaccess and add the following rewrite rules.

RewriteEngine On
RewriteCond     %{SERVER_PORT} ^80$
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

You can also add it inside the virtual host entry of the domain for which you need this redirect.

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]

Comment moderation is enabled. Your comment may take some time to appear.