It is not possible to make a redirect to the main one in nginx view links
/watchh/a./asdww/index.php /video/test/index.php /index.php should redirect to home
If you want with /Index.php on / then so.
server { ... if ($request_uri ~ "^(.*)index\.(?:php|html)") { return 301 $1; } } Or so
location ~ ^/index.(html|php)$ { if ($request_uri ~ ^/index.(html|php)) { rewrite ^.*$ / permanent; } } But then requests for /index.html and /index.php will give 301 redirects to the root of the site, and the site itself will work as before.
Source: https://ru.stackoverflow.com/questions/880356/
All Articles