How to fix the 404 error page?

Status
Not open for further replies.

addisoncave

Active Member
42
2016
1
0
Hy guys, I want to set a default php 404 error page for my server, but i don't want it to redirect to error.php instead it show the 404 message to same address which we type in browser. How to accomplish this?
 
4 comments
Code:
[COLOR=#333333][FONT=Consolas]if[/FONT][/COLOR][COLOR=#333333][FONT=Consolas]([/FONT][/COLOR][FONT=Consolas][COLOR=#008080]'check data'[/COLOR][/FONT][COLOR=#333333][FONT=Consolas])[/FONT][/COLOR][COLOR=#333333][FONT=Consolas]{[/FONT][/COLOR]    
[COLOR=#999999]     header[/COLOR]([COLOR=#BB8844]"HTTP/1.1 404 Not Found"[/COLOR]);[COLOR=#999988][I]//HTTP/1.0 || HTTP/2[/I][/COLOR]
    exit; [COLOR=#333333][FONT=Consolas]        
[/FONT][/COLOR][COLOR=#333333][FONT=Consolas]}
[/FONT][/COLOR]
 
easy to do just create a html file called 404.html or something


PHP:
if (empty($YOUR_DATA) or !$YOUR_DATA)
{


/* You can use this */     header ("Location /404.html");
/* or this                  */      echo " Any Error msg you would like to have ";



}
 
  • Steps to fix 404 error:
  • 1)Redirect the 404 error on another page. If people are visiting page which is an error page, you can inform your server to redirect people fto /special instead.
  • 2)Correct the source link. ...
  • 3)Restore deleted pages. ...
  • 4) Avoid the not found error.
 
Status
Not open for further replies.
Back
Top