Page 1 of 1

Static start page not loaded with 404

Posted: Mon Apr 06, 2009 4:09 pm
by Don Chambers
I'm trying to help someone create a s9y site with just static pages. I created a static page, and set it to be the front page of s9y. I am using URL rewriting via mod rewrite. The static frontpage is not loaded when a page is not found. .htaccess includes the usual:

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
.... etc...
s9y is 1.4.1, static page plugin is 3.74.

So, if the frontpage is normally loaded on a page not found, and a static page has been defined as the frontpage, shouldn't that static page load on a 404?

Re: Static start page not loaded with 404

Posted: Mon Apr 06, 2009 7:24 pm
by garvinhicking
Hi!

Staticpages are only loaded for view=start and not view=404 - so it's currently expected behaviour that you get the blog and not the "whatever is defined as startpage".

Changing this behaviour could lead to a lot of unexpected behaviours. In your case, I'd create a seperate event plugin that listens on the 404 event hook and fires up the display of a staticpage - however, that requires some PHP coding.

Regards,
Garvin

Re: Static start page not loaded with 404

Posted: Mon Apr 06, 2009 8:13 pm
by Don Chambers
Actually, what I decided instead was to pursue the same route I have in most of my recent templates, including Kinetic - to provide a specific 404 error message. This way the visitor knows a page was not found, instead of ending up at the start page for reasons they do not understand.

Re: Static start page not loaded with 404

Posted: Mon Apr 06, 2009 8:43 pm
by garvinhicking
Hi!

HAAAAAAAAAAAAAA!


DOUBLE-HA!


HERE we finally have it, a usage scenario for my recent plugin-api-through-template-hook. You could use the template to hook into the 404 view, and then let the template immediately fire up a specific staticpage. :-D

Regards,
Garvin

Re: Static start page not loaded with 404

Posted: Mon Apr 06, 2009 8:59 pm
by yellowled
garvinhicking wrote:HERE we finally have it, a usage scenario for my recent plugin-api-through-template-hook. You could use the template to hook into the 404 view, and then let the template immediately fire up a specific staticpage. :-D
So, something like (very simplified, in Smarty-like pseudo code) this?

"if view == '404' load staticpage pagetitle"

YL

Re: Static start page not loaded with 404

Posted: Mon Apr 06, 2009 10:28 pm
by Don Chambers
garvinhicking wrote:HAAAAAAAAAAAAAA!

DOUBLE-HA!

HERE we finally have it, a usage scenario for my recent plugin-api-through-template-hook. You could use the template to hook into the 404 view, and then let the template immediately fire up a specific staticpage. :-D

Regards,
Garvin
Always happy to give justification to your concepts Garvin!! :lol: :mrgreen: :lol: :mrgreen: