thinkphp5.1隐藏入口文件

使用phpstudy时 
tp5中的官方说明是在入口文件的同级目录下添加一个.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>

这个配置在phpstudy下没有生效

在phpstudy下.htaccess文件里面的内容应该改成:

<IfModule mod_rewrite.c>
 Options +FollowSymlinks -Multiviews 

RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] 

</IfModule>
发布了36 篇原创文章 · 获赞 8 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/weixin_41965172/article/details/89849485
今日推荐