Reputation: 1914
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.
Upvotes: 3
Views: 413
Reputation: 15794
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.
Upvotes: 4