How to redirect visitors to SSL connections

Active 0 Reply 415 Views 2021-05-19 02:04:45 web hosting

How to redirect visitors to SSL connections

This article demonstrates the way to redirect users to secure (https://) internet site connections, albeit they A non-secure URL (http://) in their browser. this text applies to Linux servers using Apache or Apache compatible web servers.

If you employ the rewrite rules in a .htaccess enter the online site's root directory, all requests are going to be redirected to HTTPS connections. Alternatively, you'll modify the rewrite rules during a specific directory's .htaccess file to limit redirection to files therein directory.

Add the subsequent lines to the specified .htaccess file to redirect users from a non-secure URL (http://) to a secure URL (https://).

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

And will be done:laughing:

Sharing is caring, show love and share the thread with your friends.

Please Login to reply this topic. If you do not have account, please Register.