How to fix what urlManager to ignore all index.php in the request?

I need to redirect all that goes to visit.com/phpBB3/index.php?tutschulte on 404. But the problem is that the urlManager to ignore all index.php in the request.
So I can write even мойсайт.ком/dfdfd/dfdfdf/dfdfd/fd/fdf/index.php/ or мойсайт.ком/index.php/index.php/index.php/index.php/index.php/ and it will lead to site/index.
How to solve it?
July 2nd 19 at 17:57
2 answers
July 2nd 19 at 17:59
This is decided by the settings of the web server for a more precise answer specify which web server is used for website and fetch its configuration.
Server nginx.
Configuration:
server {
set $host_path "/var/www/sites/MySite/frontend";
access_log /var/www/sites/MySite/log/access.log;
error_log /var/www/sites/MySite/log/error.log;

listen 80;
server_name MySite;
root $host_path/web;
set $yii_bootstrap "index.php";
add_header X-Frame-Options "SAMEORIGIN";
client_max_body_size 2048m;

charset utf-8;

location / {
index index.php $yii_bootstrap;
try_files $uri $uri/ /$yii_bootstrap?$args;
}

location ~ ^/(protected|framework|themes/\w+/views) {
deny all;
}

# disable the query processing framework to a non-existent static files
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}

# pass the PHP script to FastCGI server listening on 127.0.0.1:9000
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;

# let yii to intercept requests for nonexistent PHP files
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}

location php.
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;

# PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies for CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
fastcgi_read_timeout 300;
}

# do not allow nginx to give files beginning with a dot (.htaccess .svn .git and others)
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

}

server {
set $host_path "/var/www/sites/MySite/backend";
access_log /var/www/sites/MySite/log/access_back.log;
error_log /var/www/sites/MySite/log/error_back.log;

listen 80;
server_name admin.MySite;
root $host_path/web;
set $yii_bootstrap "index.php";
add_header X-Frame-Options "SAMEORIGIN";
client_max_body_size 2048m;

charset utf-8;

location / {
index index.php $yii_bootstrap;
try_files $uri $uri/ /$yii_bootstrap?$args;
}

location ~ ^/(protected|framework|themes/\w+/views) {
deny all;
}

# disable the query processing framework to a non-existent static files
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
}

# pass the PHP script to FastCGI server listening on 127.0.0.1:9000
location ~ \.php {
fastcgi_split_path_info ^(.+\.php)(.*)$;

# let yii to intercept requests for nonexistent PHP files
set $fsn /$yii_bootstrap;
if (-f $document_root$fastcgi_script_name){
set $fsn $fastcgi_script_name;
}

location php.
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fsn;

# PATH_INFO and PATH_TRANSLATED can be omitted, but RFC 3875 specifies for CGI
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fsn;
fastcgi_read_timeout 300;
}

# do not allow nginx to give files beginning with a dot (.htaccess .svn .git and others)
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}

} - nikita.Stracke commented on July 2nd 19 at 18:02
July 2nd 19 at 18:01
you can create a folder in the phpBB3 file index.php that simply return an error, must work with the standard settings of the server. Yes and the query will be easier, avoiding the connection of the yii core

Find more questions by tags YiiPHP