thinkphp5隐藏入口index.php文件

隐藏前:http://serverName/index.php/index/index/index

隐藏后:http://serverName/index/index/index

修改public目录下的.htaccess文件,内容如下:

Apache环境:

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

php工具箱环境:

<IfModule mod_rewrite.c>
 
    Options +FollowSymlinks -Multiviews
 
    RewriteEngine on  
 
    RewriteCond %{REQUEST_FILENAME} !-d
 
    RewriteCond %{REQUEST_FILENAME} !-f
 
    RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
 
</IfModule>

 

posted on 2019-07-25 17:20  肥嘟嘟啊左卫门  阅读(368)  评论(0编辑  收藏  举报