PHP菜鸟博客_共同学习分享PHP技术心得【PHP爱好者】
thinkphp3.2 home为默认模块,怎么在URL里面隐藏掉home
2016-3-29 菜鸟站长


默认地址已经去掉了index.php:  http://localhost/yibuzhicheng/Home/Index/index.html



希望访问的时候地址是:           http://localhost/yibuzhicheng/Index/index.html







很简单在入口文件加一行:    define('BIND_MODULE', 'Home');   请注意下这行加入的位置 不要放到最后





















<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2014 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用入口文件

// 检测PHP环境
if(version_compare(PHP_VERSION,'5.3.0','<')) die('require PHP > 5.3.0 !');

// 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
define('APP_DEBUG',True);

// 默认绑定Home模块--注意这里
define('BIND_MODULE', 'Home');

// 定义应用目录
define('APP_PATH','./App/');

// 引入ThinkPHP入口文件
require './ThinkPHP/ThinkPHP.php';

//3.2.3 版本

// 亲^_^ 后面不需要任何代码了 就是如此简单




发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容