A simple redirection for broken links

relinkto4664

New Member
YetiShare User
YetiShare Supporter
Reservo User
Reservo Supporter
Jan 1, 1970
37
4
0
https://fhscript.com/348u9043


Test this.. the site is blank. Should redirect to "File not found" what ever
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
It's blank for search engines. The page outputs a 404 which would appropriate for a file which has been removed.

You can change it if you want, the full source code is there:

In \core\page\file_download.php find:

Code:
// could not load the file
if (!$file)
{
    coreFunctions::output404();
    //coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/index." . SITE_CONFIG_PAGE_EXTENSION);
}
Replace with:

Code:
// could not load the file
if (!$file)
{
    coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/index." . SITE_CONFIG_PAGE_EXTENSION);
}
Or wherever you want it to redirect to.