我刚使用TP5有一个非常苦恼的问题, 重定向缺少index.php报错(No input file specified)
把 public 下面的 .htaccess 文件中的
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
修改成
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
在默认情况下就不会出现No input file specified.
就可以了,亲测哦!
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
记得点赞哦!