For technical reasons, it is necessary to allow execution of only one php script, and specifically - index.php in the root directory of the site. All other scripts with different names should be ignored and redirected to the main one without parameters. How to make it beautiful?

    1 answer 1

    Alternatively, at the beginning of the location accepting calls to the scripts, put the rule:

    rewrite ^/(.php)$ /index.php last; 

    Not sure whether it will work for scripts from nested directories.