A
A
Alexey2020-11-19 04:24:07
PHP
Alexey, 2020-11-19 04:24:07

How to allow GET requests in .htaccess?

How to allow GET requests in .htaccess?
at the moment it redirects everything to the index.php page removes www and other things, what to add here, please tell me so that GET requests go through, for the moment isset($_GET['text']) returns false, without all this stuff in htaccess gives true

what it is now:

RewriteEngine On
#файлы исключение
RewriteRule ^_ajax.php - [L]

#ЗАЩИТА - Блокируем все ссылки, содержащие <script>
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#ЗАЩИТА - Блокируем все скрипты, которые пытаются изменить переменные PHP Globals:
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#ЗАЩИТА - Блокируем все скрипты, которые пытаются изменить переменную _REQUEST:
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})

#Удаляем www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#Удаляем index.php
RewriteCond %{THE_REQUEST} ^.*/index.php 
RewriteRule ^(.*)index.php$ http://%{HTTP_HOST}/$1 [R=301,L]

#Убираем слеш / в конце строки
RewriteRule (.+)/$ /$1 [L,R=301]

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

#любая ссылка отправляет на index
RewriteRule ^.*$ index.php [L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-11-19
@xmoonlight

Look here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question