Static Page Plugin - Custom 404 Error Page [SOLVED]

Found a bug? Tell us!!
Post Reply
gregman
Regular
Posts: 91
Joined: Wed Aug 15, 2007 9:32 pm

Static Page Plugin - Custom 404 Error Page [SOLVED]

Post 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
WebComPas
Regular
Posts: 101
Joined: Thu Nov 22, 2007 10:14 am
Contact:

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

Post 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
Interessantes aus den Themenbereichen Computer, Internet und Programmierung unter http://www.it-blog.net
Post Reply