M
M
maks789452021-12-28 00:19:45
htaccess
maks78945, 2021-12-28 00:19:45

How to redirect from http to https in wordpress?

Good afternoon!

The site is hosted by ukraine.com.ua and a free ssl certificate Let's Encrypt
52d7702ed7.png

is connected. When "Redirect requests from http to https" is enabled, I get the error "ERR_TOO_MANY_REDIRECTS" because there is always a redirect from http to https and back.

I tried adding a redirect to htaccess with:

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


after adding my htaccess looked like this:
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


But in the end I also get "ERR_TOO_MANY_REDIRECTS".

In the database, in the options table in siteurl and home, http is specified when changing to https, the main one redirects to http all the time, and when I enter the admin panel, I get "ERR_TOO_MANY_REDIRECTS".

Tell me how can I overcome this problem, I have not been able to solve it for several days

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2021-12-28
@pro100taa

Try this https://www.hostinger.ru/rukovodstva/kak-ispravit-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question