Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
The page not found used to be created in the Assets folder with the look of the site coming from page.ss. However when started using 2.3.0 to build sites, the error page that is created has only the text "The requested page couldn't be found." There is no html markup or anything just that line of text.
How can I fix it so the error pages are created in the way they used to be?
Create a new Error Page type, and make its URL Segment 404. That way it will work.
So instead of using the built in error page that is automatically created by SilverStripe whenever dev/build is run, I create my own class and use that instead?
No, that's more work than is necessary. Just make sure that you publish the 404 page, and that it creates an assets/error-404.html file when you do.
I published the default Page Not Found and it did create the error-404.html file, however I'm still just getting the IIS 404 error page.
Maybe there is something in the web.config I need to change? Thanks for the help.
An example is this page here
You can create an ErrorPage.ss template in your Themes folder. Then when you publish your error page from the Admin area, it should use that template to generate the html file.
I am not familiar with IIS 7, but I am asuming that URL rewriting is working ok?
The generated page is just flat html though, so it is a good idea to re-direct your IIS 404 page to the one created by silverstripe.
I guess you could do this in web.config, but I only ever used that file when I was developing .net apps, and that was a couple of years ago. In IIS 6 you would do it the website properties popup.
Hope that helps,