Page 1 of 1

Static page as 404 error document

Posted: Mon Apr 05, 2010 8:50 pm
by WebComPas
Hello!

I've created a static page to be displayed in the case of 404 errors. This should be displayed if the requested blog page doesn't exist instead of the index page. Unfortunately there is no corresponding configuration option. Also I want to use it as ErrorDocument.

I would be glad, if someone could add these features to the static page plugin.

Regards,
Pascal

Re: Static page as 404 error document

Posted: Tue Apr 06, 2010 9:17 am
by garvinhicking
Hi!

If you use no URL rewriting or mod_rewrite rewriting, you could edit your .htaccess file and place it as the ErrorDocument URL there.

To make it work on a staticpage, a new page attribute "Is 404 page" would need to be created, similarly to the "Is startpage" attribute, and then the plugin would need to evaluate if $serendipity['view'] is "404" and hook into the "genpage" hook to show its output (I believe where it already does a "Is startpage" output).

If I have time I can try to implement it, if someone other wants to volunteer, that would be fine by me ;)

Regards,
Garvin

Re: Static page as 404 error document

Posted: Mon Mar 14, 2011 12:09 am
by WebComPas
I just added this feature to the plugin. So one staticpage can be used as 404 error document if the webserver is configured accordingly.

Re: Static page as 404 error document

Posted: Mon Mar 14, 2011 8:39 am
by bernd_d
garvinhicking wrote:If you use no URL rewriting or mod_rewrite rewriting, you could edit your .htaccess file and place it as the ErrorDocument URL there.

To make it work on a staticpage, a new page attribute "Is 404 page" would need to be created, similarly to the "Is startpage" attribute, and then the plugin would need to evaluate if $serendipity['view'] is "404" and hook into the "genpage" hook to show its output (I believe where it already does a "Is startpage" output).

If I have time I can try to implement it, if someone other wants to volunteer, that would be fine by me ;)
Gavin, if i am not totaly wrong you already have made such a plugin for me ;)

http://board.s9y.org/viewtopic.php?f=11&t=16928

Re: Static page as 404 error document

Posted: Mon Mar 14, 2011 3:52 pm
by garvinhicking
Hi!

But it's better to have it combined in the staticpage plugin, to be able to use that :)

Regards,
Garvin

Re: Static page as 404 error document

Posted: Mon Mar 14, 2011 4:29 pm
by bernd_d
Sure :)

With this solution, i don't need another plugin anymore ;)