IIS aspect:
Find your php.ini file, and search
;cgi.force_redirect = 1
change it into
cgi.force_redirect = 0
(attention, no semicolon).
Apache aspect:
It is easier to solve than IIS.
Just add an question mark after index.php in .htaccess file, change it into
RewriteRule ^(.*)$ /index.php?/$1 [L]
This problem may be due to a wrong suffix name resolution of Apache.
References: https://blog.csdn.net/wanganji5252/article/details/81782074