Automatically use HTTPS

How to get my site to use HTTPS when a user logs into my domain, say they print www.mysite.com. I want him to go to https://www.mysite.com .

Is there a way I can do this using plesk, or would it be nice in the root directory index to have a page redirected to https://www.mysite.com ? Or is there another way to configure it so that it automatically does it?

Thanks for helping people.

+4
source share
1 answer

When your web server starts Apache, you can use modRewrite to do this.

Add this to .htaccess , which should be located in the root of the http domain

 RewriteEngine on RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L] 
+4
source

Source: https://habr.com/ru/post/1388602/


All Articles