Welcome Guest, Not a member yet? Register   Sign In
Route 404 Over Ride sub directory issue
#1

(This post was last modified: 10-25-2015, 10:04 PM by wolfgang1983.)

Hello,

In codeingiter application/config/routes.php

I would like to know if possible to have sub directory / name

controllers > error > Not_found.php

PHP Code:
$route['404_override'] = 'error/not_found'

But it only seems to work with code below.

PHP Code:
$route['404_override'] = 'not_found'

I need it to be able to get from sub directory.

Is there any way to change it?
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply
#2

As mentioned in the user guide:
http://www.codeigniter.com/user_guide/ge...ved-routes

Quote:Same per-directory rules as with ‘default_controller’ apply here as well.

So, the 404_override setting defines a controller/method pair only, just like the default_controller setting. An error directory containing a not_found controller would only be called if the $RTR->directory was already set to 'error' by the route it was attempting to resolve and 404_override was set to 'not_found'.
Reply
#3

(10-26-2015, 01:09 PM)mwhitney Wrote: As mentioned in the user guide:
http://www.codeigniter.com/user_guide/ge...ved-routes


Quote:Same per-directory rules as with ‘default_controller’ apply here as well.

So, the 404_override setting defines a controller/method pair only, just like the default_controller setting. An error directory containing a not_found controller would only be called if the $RTR->directory was already set to 'error' by the route it was attempting to resolve and 404_override was set to 'not_found'.

I can understand not being able to use sub folder in default controller but should be able to have sub folder for 404 overrides.

I will not use override 404 then on routes I will find another way.
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB