Adding Your Own 404 Page Instead of The Browser Default

stan8837

New Member
Mar 29, 2019
3
1
3
53
Adding Your Own 404 Page Instead of The Browser Default

First off you need a new .html file called 404

You can download a free 404 file i created from the attachment in this thread

After this you need to make a small change in your .htaccess file to show the error 404 the correct way, add the following line underneath RewriteEngine On

Code:
ErrorDocument 404 /404.html
Now you need to open /core/page/file_download.php

Find line 40

PHP:
if (!$file) {
    coreFunctions::output404();
    //coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/index." . SITE_CONFIG_PAGE_EXTENSION);
}
Replace with

PHP:
if (!$file) {
    //coreFunctions::output404();
    coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/404." . SITE_CONFIG_PAGE_EXTENSION);
}
Now your new error 404 page will load every time your site comes across a missing or wrong link
 

Attachments