Thinkphp5.0 隐藏入口文件(index.php)

注:先声明,我这里用的是 phpstudy 配置的PHP环境

操作步骤:

1、打开项目文件的"public" 文件夹找到”.htaccess“文件将其打开;

Thinkphp5.0 隐藏入口文件(index.php)

2、将下面的代码替换原代码:

<IfModule mod_rewrite.c>

Options +FollowSymlinks

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

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

</IfModule>

Thinkphp5.0 隐藏入口文件(index.php)

3、完成后保存,然后在浏览器中访问:例:localhost/thinkphp5.0/public/index/index/index

Thinkphp5.0 隐藏入口文件(index.php)