Page 1 of 1

Static Page Plugin - Custom 404 Error Page [SOLVED]

Posted: Thu Apr 14, 2011 9:03 pm
by gregman
Hi there,

I ran into some trouble with customized error pages delivered by the static pages plugin. The static page plugin didn't catch all of the non-existing urls, so some where redirected to index.php. Maybe it was caused by extraordinary mod_rewrite rules, maybe not. So here is how i solved the problem.

Line 2706 changed to:

Code: Select all

if ($_SERVER['REDIRECT_STATUS'] == '404' || $serendipity['view'] == '404') {
Moved Lines 2704-2709 after 2719

Regards
Greg

Re: Static Page Plugin - Custom 404 Error Page [SOLVED]

Posted: Tue Apr 26, 2011 11:38 pm
by WebComPas
Hi Greg!

The idea of also checking for $serendipity['view'] == '404' is correct. When adding the 404 feature I also tested this but it caused many other problems. For example the contact form plugin won't work anymore.

So I think, there is only one safe solution for making the 404 feature also work if the specified blog page doesn't exist:
  • Place the staticpage plugin after all other plugins
  • Additionally check $serendipity['GET']['subpage'] that it is empty
  • In all other plugins set $serendipity['view'] = '200' if they generated a page
I think that you can't expect all these conditions to be fulfilled. Probably this will result in too many problems. Or does anyone have anther opinion on this?


Regards
Pascal