thinkphp 5.0 一些改动

1、将入口文件移到根目录下

 ① 将index.php 复制到根目录,然后修改为

// 定义应用目录
define('APP_PATH', __DIR__ . '/application/');
// 开启调试模式
define('APP_DEBUG', true);
// 加载框架引导文件
require __DIR__ . '/thinkphp/start.php';

2、隐藏访问url 中的index.php

① 将.htaccess 修改为
<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>

3、 nginx 中隐藏

location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}

  

posted @ 2022-09-20 16:03  时光一寸灰  阅读(38)  评论(0编辑  收藏  举报