Welcome Guest, Not a member yet? Register   Sign In
custom 404 page
#4

(11-30-2016, 08:13 AM)Paul1972UK Wrote: Hi Im working on a CI site which has an admin folder at the same level as the application folder, We noticed today that the custom 404 page setup in the routes file was giving a status of 200 rather than 404.


Code:
$route['404_override'] = 'error/error404';

so I added 


Code:
$this->output->set_status_header('404'); 


to the controller / method, which seemed to work... but now the admin folder just loads this 404 page? 

How do I get access back to the admin folder please? Is there something I need to setup in the routes, or Have I setup the header status wrong?

Many Thanks Paul


On CI 3 version custom 404 does not work in sub folders place in controllers folder

Code:
$route['404_override'] = 'error404';

application > controllers > Error404.php

Code:
class Error404 extends CI_Controller {...}
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
custom 404 page - by Paul1972UK - 11-30-2016, 08:13 AM
RE: custom 404 page - by neodite - 11-30-2016, 01:38 PM
RE: custom 404 page - by Paul1972UK - 12-01-2016, 09:14 AM
RE: custom 404 page - by wolfgang1983 - 12-01-2016, 02:17 PM
RE: custom 404 page - by Paul1972UK - 12-02-2016, 05:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB