5

I could not find an obvious way to handle general 404 pages in IHP.

Is there a simple way to override the default "Not Found" route on invalid pages in FrontController or Router?

  • 1
    Given this issue https://github.com/digitallyinduced/ihp/issues/367, I’d assume the answer is: currently, no. – Artem Pelenitsyn Oct 20 '20 at 21:48
  • 1
    Yes, there has been some work on that issue in the past. Here's the direction how we wan this to work: https://github.com/digitallyinduced/ihp/pull/423#issuecomment-700843156 Hopefully makes it into the next IHP release. Will then submit a answer to this SO question :) – Marc Scholten Oct 21 '20 at 05:47

1 Answers1

4

There's now an easy way to add a custom 404 page by creating a file at static/404.html. Then IHP will render that HTML file instead of displaying the default IHP not found page.

Check the documentation for more details.

(added this just in case someone get's here via google)

Marc Scholten
  • 1,351
  • 3
  • 5