问题描述: 启用rewite重定向时,出现·‘no input file specified’
的提示,重定向失败。
原因: php5.6的使用的fast_cgi,在某些情况下,不能正确识别path_info。
解决方法:
方法说明:正则结果“/$1”前面多加了一个“?”号(如下:)
- 默认的.htaccess规则如下:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
- 修改后的规则如下:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [L]