Welcome Guest, Not a member yet? Register   Sign In
Use __remap to Show 404 Page
#1

[eluser]fjamal[/eluser]
I have the following code structure:

First Step:

Code:
class MY_Controller extends CI_Controller
it has the following __remap:

Code:
public function _remap($method, $param) {

  if (method_exists($this, $method)){

             call_user_func_array(array($this, $method), $param);

  } else {
                  
                      //show 404
  
  }
}

Second Step:


Code:
class Frontend_Controller extends MY_Controller
it has all implementations that are commonly shared in frontend.

Third Step:

Code:
class Home extends Frontend_Controller
Just a regular controller that handles user interactions.


Problem:

Whenever user types a wrong controller's name e.g.
Code:
http://www.example.com/home2

or
Code:
http://www.example.com/home/indexABC

Not found page is shown. However, repeating controller's name doesn't bring up the 404 page e.g.

Code:
http://www.example.com/home/home/home/home

The above url works totally fine as if user typed
Code:
http://www.example.com/home/

Any idea how to solve this issue? I need to show 404 page when user types double+ controller's name
Code:
http://www.example.com/home/home/


Thanks




Messages In This Thread
Use __remap to Show 404 Page - by El Forum - 07-31-2012, 04:59 PM
Use __remap to Show 404 Page - by El Forum - 07-31-2012, 06:35 PM
Use __remap to Show 404 Page - by El Forum - 07-31-2012, 06:36 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 03:33 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 03:49 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 04:07 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 04:50 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 04:55 PM
Use __remap to Show 404 Page - by El Forum - 08-01-2012, 05:10 PM



Theme © iAndrew 2016 - Forum software by © MyBB