M
M
Michael_Mel2019-02-11 15:33:03
htaccess
Michael_Mel, 2019-02-11 15:33:03

Why doesn't the https switch rule work?

The following transition rule is set:

RewriteCond %{HTTP:X-HTTPS} !1
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

the work of the ssl certificate is checked on ssllabs , it
says that everything is OK:
https://mydomain.ru (HTTP/1.1 200 OK)
the domain via https is available, that is, when you directly enter it into the browser line with https, it is displayed with a green lock,
however, when you enter the mydomain.ru domain, the redirect does not occur and in the line he writes which is unreliable.
what could it depend on? tried a lot of rules. I even tried what the hoster himself offered,
Redirect 301 /index.php https://mydomain.ru
please help me with an idea !!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valentin, 2019-02-11
@romanko_vn

Try this

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question