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.

Themes

Discuss SilverStripe Themes.

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

Creating Forbidden Error Page


Reply

3 Posts   766 Views

Avatar
UKBadger

21 September 2011 at 10:11pm Community Member, 3 Posts

Hi

(Using SimpleStripe theme)

I've created a Forbidden error page and it successfully saves and publishes, and I can see the error-403.html file in the .../silverstripe/assets folder.

Problem is is that the error-403.html file that has been saved is just a blank html file.

Any idea what could be causing this, and how to fix it?

TIA

Avatar
martimiz

22 September 2011 at 2:20am Forum Moderator, 1095 Posts

I've seen that too... For the moment I don't think it can be fixed.

When SilverStripe calls the 403 errorpage, a blank page is returned, and that's what's written to the static file in assets as well... It has something to do with the ErrorPage_Controller::init() method setting the error status to 403 for this errorpage - and I somehow guess that it is now forbidden to SilverStripe as well :-)

I suppose what you could do is copy the contents of one of the other error pages in assets, and tweek the html. Then add the custom errorpage to .htaccess...

Avatar
UKBadger

22 September 2011 at 4:26am (Last edited: 22 September 2011 4:29am), Community Member, 3 Posts

Hi Martinez

Thanks for the reply

For now I've copied the code that the 'Page not found' error-404.html file contents into the blank error-403.html file, changed the wording and it now works correctly, i.e. I get the forbidden page displayed within my website design.

I also added the reference in the .../silverstripe/.htaccess file. (ErrorDocument 403 /assets/error-403.html)

Just another thing to remember I've 'fixed' in the future.

Thanks