入口index.php
<?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);
// 定义应用目录
define('APP_PATH','./Application/');
define('BIND_MODULE','Home');
// 引入ThinkPHP入口文件
require './ThinkPHP/ThinkPHP.php';
// 亲^_^ 后面不需要任何代码了 就是如此简单config.php<?php
return array(
'URL_MODEL' => 2,
);IndexController.class.php<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller
{
function _initialize()
{
echo CONTROLLER_NAME . '===' . ACTION_NAME;
}
function index()
{
}
function ceshi()
{
}
}CeshiController.class.php<?php
namespace Home\Controller;
use Think\Controller;
class CeshiController extends Controller
{
function _initialize()
{
echo CONTROLLER_NAME . '===' . ACTION_NAME;
}
function index()
{
}
function ceshi()
{
}
}访问链接http://localhost/Index/ceshi问题在这,竟然打印出Ceshi===index
除了这个地址,其它打印都没问题
附.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>最后查了一下,好像是系统环境的问题。具体是什么问题也不清楚。在入口文件得到$_SERVER中的pathinfo就不对[REQUEST_URI] => /Index/ceshi/ [sc
最佳答案