Welcome Guest, Not a member yet? Register   Sign In
Better 404 catching
#3

[eluser]Glazz[/eluser]
Hi,

this doesn't work for me, i still get the default CI 404 error page.

My routes.php
Code:
$route['default_controller'] = 'inicio';
//$route['404_override'] = 'error/index';

$route['404'] = 'error/index';



// Clientes.
//
    # Paginação.
    $route['utilizadores/(:num)']                  = 'utilizadores/index/$1';

    # Ordenação.
    $route['utilizadores/[a-z]+/[a-z]+$']          = 'utilizadores/index/$1/$2';
    
    # Paginação + Ordenação.
    $route['utilizadores/[0-9]+/[a-z]+/[a-z]+$']   = 'utilizadores/index/$1/$2/$3';
    
    # Pesquisa.
    $route['utilizadores/pesquisa/[a-z]+$']        = 'utilizadores/index/$1';

    # Pesquisa + Paginação.
    $route['utilizadores/pesquisa/[a-z]+/[0-9]+$'] = 'utilizadores/index/$1/$2';

MY_Controller
Code:
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');
class MY_Controller extends MX_Controller
{
    function _remap($method) {
        if (in_array(strtolower($method), array_map('strtolower', get_class_methods($this)))) {
            $uri = $this->uri->segment_array();
            unset($uri[1]);
            unset($uri[2]);
    
            call_user_func_array(array($this, $method), $uri);
        }
        else {
            redirect('404');
        }
    }
}

I'm using HMVC, so i tried both MX_Controller and CI_Controller, but none worked, so i don't know if this is related to HMVC...


Messages In This Thread
Better 404 catching - by El Forum - 02-16-2011, 07:36 PM
Better 404 catching - by El Forum - 02-16-2011, 08:12 PM
Better 404 catching - by El Forum - 02-16-2011, 11:41 PM
Better 404 catching - by El Forum - 02-16-2011, 11:48 PM
Better 404 catching - by El Forum - 02-17-2011, 04:33 AM
Better 404 catching - by El Forum - 02-17-2011, 10:43 AM
Better 404 catching - by El Forum - 02-17-2011, 08:41 PM
Better 404 catching - by El Forum - 02-17-2011, 09:36 PM
Better 404 catching - by El Forum - 02-18-2011, 05:35 AM
Better 404 catching - by El Forum - 02-18-2011, 06:56 AM
Better 404 catching - by El Forum - 02-19-2011, 03:47 AM
Better 404 catching - by El Forum - 02-20-2011, 01:08 AM
Better 404 catching - by El Forum - 02-20-2011, 02:00 AM
Better 404 catching - by El Forum - 02-20-2011, 02:10 AM
Better 404 catching - by El Forum - 02-21-2011, 04:23 PM
Better 404 catching - by El Forum - 02-21-2011, 06:19 PM
Better 404 catching - by El Forum - 02-21-2011, 07:09 PM
Better 404 catching - by El Forum - 02-22-2011, 03:20 AM
Better 404 catching - by El Forum - 02-22-2011, 04:38 AM
Better 404 catching - by El Forum - 02-22-2011, 11:05 AM
Better 404 catching - by El Forum - 02-24-2011, 04:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB