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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page not found has no template in Silver Stripe 2.3.0


Reply

8 Posts   3373 Views

Avatar
micahsheets

6 March 2009 at 2:39pm Community Member, 164 Posts

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?

Avatar
Nivanka

6 March 2009 at 2:43pm Community Member, 395 Posts

Create a new Error Page type, and make its URL Segment 404. That way it will work.

Avatar
micahsheets

7 March 2009 at 6:35am Community Member, 164 Posts

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?

Avatar
Sam

9 March 2009 at 11:15am Administrator, 679 Posts

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.

Avatar
Landmine

28 May 2009 at 12:28am (Last edited: 28 May 2009 12:30am), Community Member, 11 Posts

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
http://www.esfiles.com/ms-sql/

Avatar
Mo

28 May 2009 at 7:25am Community Member, 509 Posts

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.

Mo

Avatar
Landmine

28 May 2009 at 2:19pm (Last edited: 28 May 2009 2:36pm), Community Member, 11 Posts

Well that did help me, so thank you Mo

However, now here is the problem...

http://www.esfiles.com/assets/error-404.html

Was created and it looks good. But the 404 error doesn't redirect to it. Should I just modify the web.config ?

-------------

Used IIS7 to just redirect on a 404 error to http://www.esfiles.com/assets/error-404.html

Avatar
Mo

29 May 2009 at 12:23am Community Member, 509 Posts

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,

Mo