thinkphp5和thinkphp3.2.3中URL重写出现No input file specified

时间:2024-05-27 19:34:14

查询后解决办法是打开public目录下的.htaccess文件,把:RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

改为:RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]

完整版:

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] </IfModule>

转载自https://blog.****.net/dhywjx/article/details/79648160