thinkphp配置htaccess文件后出现No input file specified
如下图所示,小编配置了htaccess伪静态规则,但是通过index/index/demo访问demo方法时出现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]
- </IfModule>
复制代码
将RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
变更为下方代码,保存就可以了
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]