In asp.net I can easily redirect the user to a customer error page if there’s an unhandled error in the page by putting this on the web.config:
<customErrors mode="RemoteOnly" defaultRedirect="Oops.aspx" />
I studying php right now and what I want to happen is redirect the user to another page if there’s an unhandled error.
You don’t want to redirect if there is an error. You want to respond with http 500.
For non-fatal errors, you can use php’s
set_error_handlerandset_exception_handlerfunctions. For fatal errors, PHP will respond with 500 and a blank page, but you can configure the web server to serve a custom page. For Apache for example, you put this line in the config: