1,把public目录中的index.php移至根目录,并修改:
<?php
// [ 应用入口文件 ]
// [ 应用入口文件 ]
namespace think;
// 加载基础文件
require __DIR__ . './thinkphp/base.php';
// 执行应用并响应
Container::get('app')->run()->send();
2,把.htaccess文件也从public文件夹移至根目录,并修改:
<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>
index.php修改如下图: