Static start page not loaded with 404

Creating and modifying plugins.
Post Reply
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Static start page not loaded with 404

Post 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?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static start page not loaded with 404

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Static start page not loaded with 404

Post 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.
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static start page not loaded with 404

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Static start page not loaded with 404

Post 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
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Static start page not loaded with 404

Post 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:
=Don=
Post Reply