Suggestion: built-in "page not found" function

Ruud

.htaccess will not work on every server (i.e. on IIS)
If an existing htaccess is in place, you should add the handler to whatever is in there.
In that case, the order of the rules can be important too.

So.. a bit tricky to do that. A good explanation/tutorial would be better.
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Argos

I read some cool ideas on Ralf's site, so thanks. But the real point of my suggestion was to take the manual creation and uploading of the htaccess file out, and let WB do that. Every proper webdesigner knows how to deal with htaccess stuff. But to make WB as user friendly as possible for people without those skills and knowledge, I think it would be great if there could be an admin function for this somehow.
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

crnogorac081

Hi,

it would be nice that these custom error pages appear in Pages menu tree, like Intro page, what do you think ? 
Web developer

WebBird

By the way... An error page does not have to be a static page. It can be a script, too. This script can, for example, look into a map file to redirect old-to-new after re-organizing pages. (Did this some time after transferring static HTML pages to PmWiki.) Any other weird things are possible. :-D

Try:
http://www.sf-germany.de/einheiten/explo

This will lead to an 404 Not Found error, but you won't get it. Behind is a script that takes the unknown part of the URI ("explo" in this case) and looks into a database to find if there's an item "LIKE %explo%". If it finds an unique entry, it forwards to the right URI.

This works with external destinations as well as with local ones. ("explo" is a local one)

Just to show what can be done with a 404-handler...

doc

#7
Hi,

as usual there are several ways to achieve this:

a) manual approach in three steps
- create a hidden WYSIWYG page e.g. error404 with the text you want to display
- upload .htaccess file to document root with statement:
ErrorDocument 404 /path_to_wb/pages/error404.php
- /path_to_wb via $_SERVER['DOCUMENT_ROOT']

b) create a module which creates the .htaccess file and a dummy page (option to choose error codes)

c) the installation routine creates an .htaccess files and a dummy page if user wants it

d) follow the German step by step guide from Ralf (Berlin)

e) use the Droplet solution from Ralf

f) or ...

Doc

Waldschwein

#6
Hello,

then... *cough* Suggestion: get rid of /pages and the "placebo" pages.php, use instead mod-rewrite or similar *cough*

Yours Michael


Edit: But a Module could do that with mod_rewrite, am I right? So I think the 40x-error-pages are created with mod-rewrite, independent how WB itself creates pages. But it's just a thought, because modules (like Topics) can create yet pages of their own...


thorn

Hello,

Quote from: Argos on January 20, 2010, 06:34:20 PM
Instead of doing technical stuff in htaccess, just create a PNF-page from the backend, and switch it on. Just like the Intro Page function, I imagine. Would that be difficult to add to the core? Or maybe as a module?

as far as i know, there is no way to achieve this behaviour without a .htaccess-file in website baker.
That's because, in WolfCMS they use a global redirect (with a .htaccess-file, too) to redirect all pages to there internal representation (e.g.: http://cms.en/page1.html to http://cms.en/index.php?PAGE=page1.html). This way, missing-page-events can be handled by the CMS itself.

As opposed to this, WebsiteBaker still uses access-files in wb/pages/..., so missing-page-events will be handled by Apache instead. And the only way to tell apache what to do in case of such a missing-page-event, a .htaccess-file is needed (as described here: http://help.websitebaker.org/pages/en/knowledge-base/custom-error-pages.php ).


thorn.
[url=http://nettest.thekk.de/doku.php]Projekte[/url]

Waldschwein

Ok, but we need for that a new way of integration into the backend then. Perhaps it's a thing to realize like the multilanguage-function in WB 2.8.1: Nobody sees it, you just have to install a module, then the options are "popping out" in page settings. Perhaps for that an Admin Tool would be nice - even more settings in the (quite long) settings list could be a bit too much. But I doubt you can create a module there without changing core files...

Yours Michael

Argos

Yep! And if possible not only for 404, but maybe for other type of error pages as well  :-D
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!

Waldschwein


Argos

I just visited http://www.wolfcms.org/ and I noticed they have some kind of built-in Page Not Found function. Sounds cool. Instead of doing technical stuff in htaccess, just create a PNF-page from the backend, and switch it on. Just like the Intro Page function, I imagine. Would that be difficult to add to the core? Or maybe as a module?
Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
----------------------------------------------------------------
Please don't request personal support, use the forums!