ThinkPHP5.1 隐藏 Index.php 的一些设置

正常访问:

http://serverName/index.php/module/controller/action/param/value/...

隐藏Index.php文件,只需修改.htaccess文件

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

就是在这段代码中的index.php后面加个?,斜杠("/")好像可以删除

猜你喜欢

转载自blog.csdn.net/qq_28137309/article/details/86014406