La reasignación de PyroCMS salió mal

I have this remap:

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);
        }
    }

On my local machine it works fine, but on my test-production it only redirects to index() no matter WHAT I input as querystring. Will someone please help me debug this?

The routes.php is equal on both servers.

If i try to change my index function to only output the requested uri like this:

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

only "id : " gets output. Hence the $id is lost somewhere in transition, but I really don't know why

SOLUTION in system/cms/config/config.php Tuve $config['uri_protocol'] ) 'PATH_INFO', but on my production server, this didn't work, so I changed it to 'AUTO' Y funcionó.

preguntado el 08 de noviembre de 11 a las 13:11

Seems that it is a rewrite issue. Have you tried use the same rules in both servers? -

@NomikOS - The routes are the same on both servers, there is a discrepancy in my config file due to the fact that the base_urls are different (one is localhost and other is dominio) -

Good for you! In any case I said "rules", ie, rewrite rules (possibly in .htaccess). That could cause similar problems when you change servers. Please tell me if the "pretty urls" still works after change to $config['uri_protocol'] = 'auto'. Thanks.- -

@NomikOS - if by pretty you mean URI segmented like controller/method/parameter then yes. -

1 Respuestas

in system/cms/config/config.php Tuve $config['uri_protocol'] = 'PATH_INFO', but on my production server, this didn't work, so I changed it to 'AUTO' Y funcionó.

respondido 14 nov., 11:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.