.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ============================ EXT: 404 Error Page Handling ============================ :Author: Kasper Skårhøj :Created: 2002-11-01T00:32:00 :Changed: 2004-11-15T14:16:54 :Author: Boris Nicolai :Email: boris.nicolai@andavida.com :Info 3: :Info 4: .. _EXT-404-Error-Page-Handling: EXT: 404 Error Page Handling ============================ Extension Key: **error\_404\_handling** Copyright 2004, Boris Nicolai, This document is published under the Open Content License available from http://www.opencontent.org/opl.shtml The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.com .. _Table-of-Contents: Table of Contents ----------------- **EXT: 404 Error Page Handling 1** **Introduction 1** What does it do? 1 **Adminstration 1** **Known problems 2** **To-Do list 2** **Changelog 2** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ Error\_404\_handlingoffers the possibilty to assign to domain-records custom error-pages if the page inside the database was not found or a file on the server was not found .. _Adminstration: Adminstration ------------- This section shows you, how the extension exactly works, why the development was necessary and how to setup step by step. .. _generated: ((generated)) ^^^^^^^^^^^^^ .. _Why-this-extension: Why this extension? """"""""""""""""""" The behaviour so far: If a FILE (eg. my\_new\_index.htm) was not found, the user got by default the browsers errorpage displayed.If a Typo3-Page was not found, the behaviour was (in my opinion) strange: A (to me) random page was displayed (if a page was displayed). If the pased id wasn´t a number the page inside the page-tree one level above the current page was called. It also didn't work to assign to a domainrecord a specific error-page, only an errorpage for ALL domains. Now the behaviour is quite straight forward: If a page or file was not found the extension looks for an errorpage that is assigned to the current domain and displays it. If no errorpage was found, then you get a clear message. The extension also automaticly sends an email to the administrator that the current URL was not found including the referer (if available). .. _How-does-it-exactly-work: How does it exactly work? """"""""""""""""""""""""" When a page or a file was not found, the (overwritten) function *pageNotFoundHandler ()* in *class.tslib\_fe.php* extracts the domain of the current URL and searches for a corresponding domain with an errorpage in the table sys\_domain.If it was found a redirect to the new URL is done.Therefore you have to assign of course in the page- administration an errorpage to a domainrecord, a feature that offers you this extension. Remark on File-not-found: A directive in the .htaccess redirects to a new page in the root of your website which is similar to the index.php in the root. It then simply calls again the function *pageNotFoundHandler ()* in *class.tslib\_fe.php.* .. _Setup: Setup """"" Although you have to adjust some parts manually with modifying some files it should not make any trouble at all. After installing the extension you find in the extension's folder another folder called “files”. This folder contains the files *404page\_not\_found.php* and *example.htaccess* . First of all copy the file *404page\_not\_found.php* into the root of your domain (same directory that contains the files *clear.gif* , *index.php* and *showpic.php* ). Then open the file *example.htaccess* in a texteditor AND the file *.htacess* that you find again in the root of your website (see above). If there is no file called . *htacess* then create a empty text-file in the root and rename it to . *htacess* ! Into the *.htaccess* in the root paste the following lines out of example.htaccess or from here at the very end of the file: ErrorDocument 404 /path\_to\_your\_typo\_root/404page\_not\_found.phpErrorDocument 500 /path\_to\_your\_typo\_root/404page\_not\_found.php Just make sure that the path is set correctly! Now go to the install-tool of typo3 in your administration, look for the flag *[warning\_email\_addr]* and insert here an emailaddress where a message shall be send if a page was not found. Nearly done! You just have to open each domainrecord and assign an URL with or without http:// in the field “Redirect to an URL if a page...”. That's it! |img-1| One remark: It doesn't matter in which format the URL of the domainrecord is.If the requested URL http://www.mydomain.com wasn´t found, then the extension will find as domainrecord http://www.mydomain.com as well as www.mydomain.com, as well as http://mydomain.com as well as mydomain.com. .. _Known-problems: Known problems -------------- - This extension was so far not tested with linux and the simulateStaticDocuments, but should normally make no problems - This extension may not work if you have another extension installed that extends the class.fslib\_fe.php like speakinguri or sourceopt (another extension from me). This problem is well known and I'm already working on a work-around. .. _To-Do-list: To-Do list ---------- \- so far nothing .. _Changelog: Changelog --------- \- 0.1.1 Bug: If the domain without any parameters is requested then the error-page was displayed instead of homepage \- 0.1 Fixed a small bug where the field-description in the backend wasn't displayed \- 0.0.1 inicial development |img-2| EXT: 404 Error Page Handling - 3 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.jpeg .. :align: left .. :border: 0 .. :height: 500 .. :id: Grafik1 .. :name: Grafik1 .. :width: 450 .. |img-2| image:: img-2.png .. :align: left .. :border: 0 .. :height: 32 .. :id: Graphic1 .. :name: Graphic1 .. :width: 102