tp5在phpstudy下URL无法去掉index.php的解决方案

  • 内容
  • 评论
  • 相关

phpstudy (apache)中URL无法去掉index.php的解决方案

tp5默认设置的.htaccess文件在wamp中都可以实现了去掉(隐藏)index.php,但是在phpstudy(apache)中运行tp5时却无法正常去掉index.php,错误的原因是在phpstudy中tp5官方的.htaccess文件无效,解决办法如下:


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

修改为

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



如下图:

1.png



本文标签:

版权声明:若无特殊注明,本文皆为《菜鸟站长》原创,转载请保留文章出处。

本文链接:tp5在phpstudy下URL无法去掉index.php的解决方案 - http://wziyi.net/?post=183

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论

1条评论
  1. avatar

    forex Lv.1 回复

    Thanks for sharing your thoughts on PHP菜鸟博客.
    Regards

    IP数据库文件不存在或者禁止访问或者已经被删除!