D
D
Danila2016-08-03 16:54:35
htaccess
Danila, 2016-08-03 16:54:35

How to disable GET requests to index.php using .htaccess?

In the access.log of my server I constantly find requests of the following form:
GET site.ru/?page=Avtomati-na-realnie-dengi
Now I have banned all requests starting with the word "page" with the following construction:

#Блокируем ботов
RewriteEngine On
RewriteCond %{QUERY_STRING} page= [NC]
RewriteRule ^.*$ - [R=404,L]

Question: how can I redirect to the 404 page all requests like www.site.ru/?xxx=xxx and www.site.ru/?xxx where xxx are any characters to the index.php file through the .htaccess file?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question