Is it possible to set a static 404 error page without the need to create this page in the CMS SiteTree?
I tried setting an ErrorPage.ss in the Layout folder with the error text in there. It only works when the error page is created in the SiteTree.
The 404 error page in the site tree outputs the page html to /assets/error-404.html for use in the case the site tree 404 page is not found.
In our main .htaccess should be the following line that sets where the server should look for the static 404 error page:
ErrorDocument 404 /assets/error-404.html
If we unpublish our 404 error page in the site tree the server will use this static html page. We can then edit the /assets/error-404.html file to control the static 404 error page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With