Where is the standard page template for 404 errors on the Apache?

For several reasons, I do not need my own template, but I need a standard one. Because of the mvc structure and the single entry point, I can't just throw out a 404 error. Rather, I can, but only samopisny, for most projects suitable, but not for the current.

I connect the headers, and then, in theory, you just need to connect the template. Which way is it?

header ("HTTP / 1.0 404 Not Found");

header ("HTTP / 1.1 404 Not Found");

Of course, I can quickly copy it myself, because everything is simple, but as I understand it, it is stored somewhere and there is no sense to reinvent the wheel.

  • In the Apache directory in error/HTTP_NOT_FOUND.html.var look. - Visman

1 answer 1

In the root directory of the site there is a .htaccess file (if not, create it). Paste this line into the file ErrorDocument 404 /error404.html Then create the file error404.html. That's all! 404 should work.

  • You do not understand me. I know how to create an alternative 404 page. I was interested in the question of where the default error page of 404 is stored. She's in fact stored somewhere. And ErrorDocument with a single entry point will not work. It is done because in the routing check the presence of the controller. - Floyat
  • Clear. What is your OS? - Daniel Abyan