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;
}
}

浙公网安备 33010602011771号