Blogger Information
Blog 1
fans 0
comment 0
visits 1557
Related recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
TP5-隐藏url中的index.php
灬彬的博客
Original
1557 people have browsed it

tp5对URL简化,不做简化情况下我们访问的是localhost/public/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