Jump to content
Hurme

pagefileSecure error handling

Recommended Posts

Hello,

pagefileSecure works wonders, but how can I catch the error message and replace it with something more human instead of the "Internal Server Error" that pops up? Best scenario for me, would be to redirect the user on another page instead.

Share this post


Link to post
Share on other sites
21 hours ago, Hurme said:

instead of the "Internal Server Error" that pops up

"Internal Server Error" or "Page Not Found"? The latter is what you should be seeing for inaccessible files, and that's the correct thing for ProcessWire to do according to HTTP standards. If you see an internal server error (status code 5xx), something's wrong.

For a "Page Not Found" error, PW renders the "404 Not Found" page under "Home" unless you have configured a different page as $config->http404PageID in site/config.php. You can create your own error page template and change to that in the page properties to adapt the output and make it more dynamic.

 

  • Like 1

Share this post


Link to post
Share on other sites

Internal Server Error. It only seems to happen when user tries to access files protected with PageFileSecure. Otherwise the 404 pages work normally.

Share this post


Link to post
Share on other sites

That shouldn't happen, but you should be able to see what went wrong either in the http server's error log or in the PHP log. My first guess would the standard template's PHP code, but it could be a lot of things.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...