0

我有这个重映射:

public function _remap($method, $params = array()) {
        if (method_exists($this, $method)) {
            if ($this -> uri -> segment(1)) {
                $this -> index($this -> uri -> segment(1));
            } else {
                $this -> index();
            }
        } else {
            return call_user_func_array(array($this, $method), $params);
        }
    }

在我的本地机器上它工作正常,但在我的测试生产中,无论我输入什么作为查询字符串,它都只会重定向到 index()。有人可以帮我调试一下吗?

两台服务器上的 routes.php 是相等的。

如果我尝试将我的索引函数更改为只输出请求的 uri,如下所示:

function index($id = null)
{
    $this->output->set_output('id: ' . $id);
    return;

只有“id:”得到输出。因此 $id 在过渡的某个地方丢失了,但我真的不知道为什么

system/cms/config/config.php我有解决方案,但是 在$config['uri_protocol'] ) 'PATH_INFO'我的生产服务器上,这不起作用,所以我将其更改为'AUTO'And it works。

4

1 回答 1

0

system/cms/config/config.php我有$config['uri_protocol'] = 'PATH_INFO',但是在我的生产服务器上,这不起作用,所以我将其更改为'AUTO'And it works。

于 2011-11-13T22:24:30.717 回答