Redirect to custom 404 page when somebody enters random or misspelled unexistent controller in URL - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Redirect to custom 404 page when somebody enters random or misspelled unexistent controller in URL (/showthread.php?tid=48405) |
Redirect to custom 404 page when somebody enters random or misspelled unexistent controller in URL - El Forum - 01-15-2012 [eluser]luismartin[/eluser] Considering this URL: http://www.mysite.com/history if I misspell the controller, or I enter a random one, like this http://www.mysite.com/sdsdrgerg I get this error (with a 'development' environment established): Fatal error: Class 'CI_Controller' not found in C:\path\to\site\system\core\CodeIgniter.php on line 231 I'd like to redirect any bad request to my site to a custom 404 page, while keeping the 404 http code. Any suggestion appreciated. |