1.将public下的index.php和htaccess文件移到根目录下

TP5.1隐藏public和index.php_根目录

2.修改index.php文件

注意这里,需要修改

TP5.1隐藏public和index.php_thinkPHP_02

3.修改htaccess文件

/*
author:咔咔
wechat:fangkangfk
*/
<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>

访问路径:

TP5.1隐藏public和index.php_thinkPHP_03