• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Prevent Access to Custom 404 Controller

#1
[eluser]fjamal[/eluser]
I have a custom '404 Not Found' page handled by Custom404 controller.

Unfortunately, custom404 can be accessed directly via URL as http://www.example.com/ci_proj/custom404

I want to prevent custom404 to be accessed directly via URL, so i decided to put it under a folder and set .htaccess for the folder.

I put custom404 into a folder named 'my_error_page' and then fixed
Code:
$route['404_override'] = 'custom404';
to
Code:
$route['404_override'] = 'my_error_page/custom404';

NOTE: custom404.php resides under applications/controllers along with other controllers such as home, etc.

When i type a wrong controller name for the sake of testing, i don't get the 404 page anymore. I get this error:

Quote:Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.

Any idea how to prevent user's from accessing Custom404 controller? I do not want to do it via _remap.

Thanks



Messages In This Thread
Prevent Access to Custom 404 Controller - by El Forum - 08-08-2012, 04:31 PM
Prevent Access to Custom 404 Controller - by El Forum - 08-08-2012, 11:00 PM
Prevent Access to Custom 404 Controller - by El Forum - 08-09-2012, 09:15 AM
Prevent Access to Custom 404 Controller - by El Forum - 08-09-2012, 10:21 PM
Prevent Access to Custom 404 Controller - by El Forum - 08-11-2012, 01:12 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.