M
M
Morfeey2017-10-24 10:28:04
htaccess
Morfeey, 2017-10-24 10:28:04

Two entry points?

The bottom line is that all requests fly to index.php. Is it possible to make it so that if the call to API.php, then the request flew to it?
I don't know much about these rules myself. Here is the entire code of the file:

AddDefaultCharset UTF-8

Options All -Indexes

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]

Options +FollowSymLinks
RewriteEngine On
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]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2017-10-24
@shambler81

Without any OR
Just add like this around the string
And don't forget to escape \=
And it's easy enough to exclude a file when one of the conditions doesn't work.
In the current case it is not a file (file name)

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

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question