zazvorniki
zazvorniki

Reputation: 3602

codeigniter custom 500 error

At this very moment I do not have any 500 error being thrown, but in case I ever do in the future I'm trying to customize a page so users never see that awful white screen.

I am having trouble adding said page. I have the page made and a controller that loads the page, but when I try and route the page in the route file or route it using .htaccess I'm still getting that white screen.

This is what I have tried in my route file

$route['500_override'] = 'notFoundErrorPage/serverError';

and then this is what I have tried in my .htaccess

ErrorDocument 500 http://writeyourfiction.com/NotFoundErrorPage/serverError

any help would be wonderful!

Upvotes: 1

Views: 3871

Answers (2)

Aken Roberts
Aken Roberts

Reputation: 13467

CodeIgniter does not have any custom error handlers aside from 404_override, so using one for any other HTTP code will be fruitless.

Apache has custom error pages as you've already attempted, but there are a couple of things to note that may be affecting your results:

1: A local URL begins with a /

A local URL to redirect to (if the action begins with a "/").

2: Specifying in an .htaccess may require additional configuration:

It may be used in .htaccess files if AllowOverride is set to FileInfo.

If you seek additional help, either here or elsewhere, please provide more information about your server environment: operating system, web server (e.g. Apache) and version, any relevant add-ons or modifications you may have made, etc.

Upvotes: 1

stormdrain
stormdrain

Reputation: 7895

It depends on the server software you are using. If you are using Apache, see here: http://httpd.apache.org/docs/2.2/custom-error.html

If you aren't using apache, google "[webserver software] custom 500 page".

If you're still having trouble, try asking on serverfault.com.

Upvotes: 0

Related Questions