## # 将public目录所有文件移动到根目录
![](https://img.kancloud.cn/49/71/4971a8de0f5bbf3ad707438e9940d56a_482x242.png)
## # 将`index.php`的内容修改为以下内容
~~~
<?php
// [ 应用入口文件 ]
namespace think;
require __DIR__ . '/vendor/autoload.php';
// 执行HTTP应用并响应
$http = (new App())->http;
$response = $http->run();
$response->send();
$http->end($response);
~~~
## # 如果使用的是sqlite数据库需要修改文件位置信息
![](https://img.kancloud.cn/d6/4d/d64daf53ea4edccac20c2e7a4b2768ff_428x663.png)
## #提示
> 虚拟主机方式存在很多安全问题如无需要,请勿开放给他人使用
> 如有可能请将`.env、database.db、日志`等文件设置为http不可访问状态
> 如果不知道搞那就算了,仅仅只是一些个人的程序信息,没有太大影响
## #伪静态
### # Apache
* [ ] windows系统
~~~
<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>
~~~
* [ ] Linux系统
~~~
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
~~~