TP5隐藏url中的index.php

public文件夹下,有个.htacess文件,没有则新建一个, 如果已有这个文件,原文件内容如下:

<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>

如果此时还是报错 : “No input file specified.”;

那么就重写规则把最后一行

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

改为

RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]

即可!