tp5、tp5.1、tp6及laravel-admin更改后台入口地址 ,老年人记忆系列,记不住就copy一下提高效率
thinkphp5
在public下新建项目入口名.php 例如admintest.php
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
// 定义应用目录
define('APP_PATH', __DIR__ . '/../application/');
define('BIND_MODULE','admin');//绑定后台模块
// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';
app/config.php
// 禁止访问模块
'deny_module_list' => ['common','admin'],//添加后台模块admin
访问地址由http://localhost/admin/index/index变为http://localhost/admintest.php/index/index
thinkphp5.1
在public下新建项目入口名.php 例如admintest.php
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
// [ 应用入口文件 ]
namespace think;
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
// 加载基础文件
require __DIR__ . '/../thinkphp/base.php';
// 支持事先使用静态方法设置Request对象和Config对象
// 执行应用并响应
Container::get('app')->bind('admin')->run()->send();
config/app.php
// 禁止访问模块
'deny_module_list' => ['common','admin'],//添加后台模块admin
访问地址由http://localhost/admin/index/index变为http://localhost/admintest.php/index/index
thinkphp6
config/app.php
// 应用映射(自动多应用模式有效)
'app_map' => ['admintest'=>'admin'],
访问地址由http://localhost/admin/index/index变为http://localhost/admintest/index/index
laravel-admin
config/admin.php
'route' => [
'prefix' => env('ADMIN_ROUTE_PREFIX', 'admintest'),
'namespace' => 'App\\Admin\\Controllers',
'middleware' => ['web', 'admin'],
],
访问地址由http://localhost/admin/变为http://localhost/admintest/
你好我现在想把
把访问地址由http://localhost/admintest.php变为http://localhost/admintest/也就是去掉.php还需要修改哪里