Welcome Guest, Not a member yet? Register   Sign In
Create Custom 404 error page
#1

(This post was last modified: 10-04-2018, 08:28 AM by imabot.)

Hi, I'm new to CodeIgniter, and it's not clear for me on how to create a custom 404 page. I already read the following posts :

https://forum.codeigniter.com/thread-66769.html
https://forum.codeigniter.com/thread-66110.html
https://forum.codeigniter.com/thread-64942.html
https://forum.codeigniter.com/thread-64591.html
https://forum.codeigniter.com/thread-64591.html
https://forum.codeigniter.com/thread-61587.html

and the following links:

https://stackoverflow.com/questions/3447...error-page
https://www.codexworld.com/codeigniter-c...rror-page/
http://www.bourzeix.com/weblog/post/2012...odeIgniter
https://www.lucidar.me/en/codeigniter-3-...e-ignitor/

The last one is probably the most interesting and I concluded there are two options :
  • Update the content of /application/views/errors/html/error_404.php
  • Create a new route : $route['404_override'] = /myController/myMethod
None is satisfying because the first option prevent you from using custom templates for header and footer, and the second one doesn't work when the error_404() function is called.

What is the best practice to create a custom 404 error page ?
Reply


Messages In This Thread
Create Custom 404 error page - by imabot - 10-04-2018, 07:08 AM
RE: Create Custom 404 error page - by ignitedcms - 10-04-2018, 09:28 AM
RE: Create Custom 404 error page - by imabot - 10-04-2018, 09:48 AM
RE: Create Custom 404 error page - by php_rocs - 10-08-2018, 07:59 AM
RE: Create Custom 404 error page - by imabot - 10-08-2018, 09:47 AM
RE: Create Custom 404 error page - by yafenic34 - 04-12-2020, 11:40 PM



Theme © iAndrew 2016 - Forum software by © MyBB