CodeIgniter Forums
404 error not database error ? - 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: 404 error not database error ? (/showthread.php?tid=18138)



404 error not database error ? - El Forum - 04-27-2009

[eluser]umefarooq[/eluser]
Hi how we can show 404 error page not A Database Error Occurred which also showing query, if any database error come it always shows 404 error message,


404 error not database error ? - El Forum - 04-27-2009

[eluser]Barouma[/eluser]
It is not possible to customize your 404 error page if your web host has not enabled this facility for your website.

If your web host has this facility, you will usually find mentioning of this information somewhere in their documentation. In fact, if they mention somewhere that you can customize a file named ".htaccess", it probably means that you can also customize your 404 File Not Found error page.

The steps in customizing a 404 error page are given below.
Step 1: Create a customized 404 File Not Found Error page.
Step 2: Create a .htaccess file
Step 3: Upload both files.
Step 4: Test the page.


404 error not database error ? - El Forum - 04-27-2009

[eluser]TheFuzzy0ne[/eluser]
I'd also suggest against doing that. If you're getting a database error, it should be handled gracefully. Throwing a page cannot be found error just seems wrong, as the page could be found, it was just a database error. Sorry, but hiding a database error behind the guise of being a 404 error just doesn't seem right to me.


404 error not database error ? - El Forum - 04-27-2009

[eluser]umefarooq[/eluser]
as you can see when every database error is coming CI always showing query also which is not good, also showing tables name, in that case anybody try to inject sql and delete the table, how it is possible to hide queries not visible for online version.


404 error not database error ? - El Forum - 04-27-2009

[eluser]TheFuzzy0ne[/eluser]
The query won't be shown if you disable db_debug in your config/database.php file. The query is only shown to help developers debug their app. If your app is on a production server, disable database debugging. Smile