thinkphp5解决在apache中重写规则不生效的问题[No input file specified.]

在public目录下面,找到.htaccess文件,修改最后一行

 RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]  在index.php后面加 ? 号,保存,重启Apache即可

 

源文件


  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

修改后


  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]

 

你可能感兴趣的:(thinkphp5)