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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

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

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

Framework (only) and custom error pages


Go to End


2 Posts   710 Views

Avatar
hello_world

Community Member, 19 Posts

26 June 2014 at 10:35am

Hi,
I use only SilverStripe Framework (3.1.5) and I have problem with handling error page.
In CMS we have page type "ErrorPage". We set error code and content - OK.
But how build error page in framework controller?
1) When page not found SilverStripe returns 200 code.

[response:protected] => SS_HTTPResponse Object
(
[statusCode:protected] => 200
[statusDescription:protected] => OK
[headers:protected] => Array
(
[Content-Type] => text/html; charset=utf-8
)

[body:protected] =>
)

But in GoogleChrome inspector is 404

2) How set custom error page template? I use nginx and set error page - but when page is not found, only I can se is empty - white screen.

best regards

Avatar
Willr

Forum Moderator, 5523 Posts

28 June 2014 at 8:00pm