M
M
Mesuti2020-08-05 12:44:30
htaccess
Mesuti, 2020-08-05 12:44:30

htaccess error too many redirects when adding https redirect?

Hey!
Add a redirect to https

RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

Why is it starting to write too many redirects?
I tried to specify this redirect at the beginning of the file, in the middle and at the end.
How to fix?

Generic htaccess code
Options +FollowSymLinks
Options -Indexes

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\. [NC] 
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ index.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2020-08-05
@shambler81

https://bertal.ru/index.php?a566754
what exactly is in the cycle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question