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   3415 Views

Avatar
micahsheets

Community Member, 165 Posts

6 March 2009 at 2:39pm

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

Community Member, 400 Posts

6 March 2009 at 2:43pm

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

Avatar
micahsheets

Community Member, 165 Posts

7 March 2009 at 6:35am

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

Administrator, 685 Posts

9 March 2009 at 11:15am

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

Community Member, 11 Posts

28 May 2009 at 12:28am

Edited: 28/05/2009 12:30am

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

Community Member, 510 Posts

28 May 2009 at 7:25am

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

Community Member, 11 Posts

28 May 2009 at 2:19pm

Edited: 28/05/2009 2:36pm

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

Community Member, 510 Posts

29 May 2009 at 12:23am

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