blank page when accessing a nonexistent file

iamdmitriy3390

New Member
YetiShare User
Dec 26, 2013
27
0
1
If your browser then write random characters yetishare produces a blank page, and you need to gave a message "File not found."

http://fhscript.com/783cn8we47crybe7w4bcan

http://fhscript.com/1234

http://fhscript.com/321321
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
It returns a 404 error on the page, which is the correct behaviour if a file doesn't exist. You can amend it by looking at around line 17 of file_download.php. There's a redirect you can comment out if you want it going to the index page or elsewhere:

Code:
if (!$file)
{
    output404();
    //redirect(getCoreSitePath() . "/index." . SITE_CONFIG_PAGE_EXTENSION);
}
 

dfdssfsfd3806

Member
YetiShare User
Apr 4, 2014
271
0
16
I did and it does not matter the page remains blank
I made a 404 page I modify your code
     redirect (WEB_ROOT "/ 404.php".)

I always blank page
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
That code wont work, it'll need to be like this:

Code:
redirect(WEB_ROOT."/404.php");
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
I tried this trick on my website but i am still getting a blank page for 404 pages

Here is the code in file_download.php file
if (!$file)
{
coreFunctions::eek:utput404();
//coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/index." . SITE_CONFIG_PAGE_EXTENSION);
}

I changed it to these but none worked..
coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/404." . SITE_CONFIG_PAGE_EXTENSION);
coreFunctions::redirect(coreFunctions::getCoreSitePath() . "/404.html");
coreFunctions::redirect("http://www.mysite.com/404.html");

Please help.
Thanks