This mod issues a 404 status code that does not change the URL while displaying a TNG page. The mod replaces all occurrences of thispagedoesnotexist.html with a function. Any links to people, families, media, cemeteries, places etc. is captured. This is a true 404 status code and not a "soft" 404 code where a page is shown or redirected resulting with a 200 page OK status code.
The way the page is displayed is dependent on the 404_page.php file. If the file is in the TNG root folder, additional content is shown. If it is not found a generic 404 page is shown. The 404_page.php file can be customized to show additional message or links. If the 404_page.php is used, languages must be added to the cust_text.php file for the active language(s). Examples of the text format is included in the message_examples.php file.
To create a 404 error manually, go to an individual's page. In the browser URL type some numbers or letters after the person id= and press enter.
By default the mod displays the 404 error and a TNG page.
Administrators can change the message to something else if text is added in the cust_text.php file.
Administrators can also use a 404_page.php file to display links or other messages.
The 404_page.php and message_examples.php files are included in the 404 file folder.
Links can also be placed inline.
You can check the network status code by opening the browsers inspection window and select Network.
Select the reload option to display the page status information. The page must be reloaded because the status code is only sent when the page loads.
The URL on the first line displays a 404 status code and there is a one warning at the top. The remainder of the page will show a 200 status which is normal because some page content loaded. The 404 code tells users, bots and crawlers the URL is unavailable so bots and crawlers will not store the URL address.
The 404 error log lets administrators know about bad links. Keep in mind hack attempts will also be shown if someone modifies the URL. The URL will contain unusual characters and commands like AND, OR and UNION. The error log can be disabled in mod options.
TNG WIKI Download Link
Revisions:
18 Sep 2024 - Rewrote mod and created a second cfg file to install the optional 404 page file and languages.
16 Sep 2024 - Reconfigured 404_page.php in avoid PHP 8.2 warning.
15 Sep 2024 - Fix undefined variables warning.
07 May 2024 - Records IP address in the 404 log file.
25 Dec 2023 - Changed inline CSS styling so mytngstyle.css can override the default CSS. Added more instructions for creating a custom 404 page.
22 Dec 2023 - Reworked mod so 404-page.php file is optional. Fixed code so users can change the default error message without using the 404-page.php
file. Added an example text file so users can add their own messages to the custtext.php file(s) for the language(s) they are using.
18 Dec 2023 - Added an error log file16 Dec 2023 - First public release