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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1128 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