A
A
alh_22016-01-19 15:55:36
PHP
alh_2, 2016-01-19 15:55:36

How to redirect to https in apache?

Guys help me make a normal request so that if a person enters

www.site.ru, site.ru, http://www.site.ru, http://site.ru
always, ALWAYS, all the pages that he entered in this way were redirected to https://site.ru . In the net, some kind of nonsense, then a cyclic redirection, then it only works with one thing.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
littleguga, 2016-01-19
@littleguga

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question