I
I
Ilya Beloborodov2016-09-03 18:24:53
Apache HTTP Server
Ilya Beloborodov, 2016-09-03 18:24:53

Always redirecting from HTTP to HTTPS?

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

Under such a condition, there is obsession. Eternal HTTP to HTTPS redirect.
Although if you just go to https://example.com - then everything is fine.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-09-03
@xmoonlight

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} =off
    RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question