thinkphp3.2 home为默认模块,怎么在URL里面隐藏掉home

  • 内容
  • 评论
  • 相关

默认地址已经去掉了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 版本

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


本文标签:

版权声明:若无特殊注明,本文皆为《菜鸟站长》原创,转载请保留文章出处。

本文链接:thinkphp3.2 home为默认模块,怎么在URL里面隐藏掉home - http://www.wlphp.com/?post=68

发表评论

电子邮件地址不会被公开。 必填项已用*标注