Blogger Information
Blog 5
fans 0
comment 2
visits 23875
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TP5+Apach隐藏index.php方法
郑小飒的博客
Original
1016 people have browsed it

这篇文章介绍的内容是关于TP5怎么隐藏index.php,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下


tp5对URL简化,不做简化情况下我们访问的是localhost/index.php/index/index/index ,做简化后省去index.php。

我们需要找到public下面的.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>

这样就可以直接访问localhost/index/index/index 了


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post