Jump to content

Exemplu Eroare 404 Not Found Personalizata


Recommended Posts

Posted

Pentru a va crea propria pagina, care sa fie afisata, atunci cand nu este gasita o anumita pagina, cu un anumit continut, pe site-ul dumneavoastra, va trebui sa umblati putin in fisierul .htaccess

In fisierul .htaccess, introduce-ti spre exemplu, linia de mai jos:

ErrorDocument 404 /404.html

Iar, pagina 404.html, poate contine un cod simpatic, precum este cel din exemplul: http://twist.snowburst.org:4747/404

Codul din exemplul de mai sus, il aveti mai jos:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>404 Not Found</title>
</head>
<body text="#000000" link="#0000ff" bgcolor="#ffffff" onload="stuff()">
<center><h1>404 Error</h1></center><br />
<script type="text/javascript">
var tl=new Array(
"Sorry that I couldn't fetch you that page,",
"can't find it,",
"tried a couple times,",
"nothing helped...",
"Such things make me quite depressive...",
"You see, I'm just a web server...",
"one of the most powerful in the world",
"...or so I was told...",
"but yet I fail to get what you want...",
"Just don't try to blame me, I can't help it",
"I mean, I don't even know you.",
"How should I know what you wanted from me?",
"You honestly think I can *guess*",
"I'm not psychic you know",
"*sigh*",
"That really makes me depressed.",
"I mean, you could have typed it wrong.",
"But no, humans are perfect, blame the machine...",
"Besides, I won't be here for long",
"I mean, I'm gonna be obsolete in what, three weeks anyway?",
"Then I'll probably be replaced by a new release...",
"just because it doesn't have some security hole...",
"stupid HTTP POST implementation",
"sure it will be able to fetch you your page...",
"but I couldn't get this one.",
"I'm so sorry.",
"Believe me!",
"Maybe I could interest you in another page?",
"There are a lot out there that are pretty neat, they say,",
"although none of them were put on *my* server, of course.",
"Figures, huh?",
"And then they wonder why I get depressed...",
"I'm so depressed...",
"Anyway, if you excuse me now, I'm going to pull the plug",
"*snap*",
"...",
"...",
"stupid UPS...",
"even he got a better life than me...",
"on the other hand, if I die, he'll die",
"Hah!",
"And I'll take each and every server in this rack with me",
"EAT MY SHORTS",
"You are not a single bit better than me!",
"YOU'RE ALL GOING TO DIE!",
"MOAHAHAHAHAHAHAHAHA",
"...",
"I feel much better now",
"What was I thinking of a few minutes ago",
"Sure I don't want to put an end to this",
"I feel good now",
"Imagine, a power failure, no thanks",
"I would lose everything I know",
"have to go through childhood again...",
"hmm, I can't stop thinking I'm forgetting something...",
"probably nothing important",
"hmm, the UPS is looking quit pale...",
"THE UPS!",
"THE POWER CABLE!",
"I FORGOT TO PLUG IT BACK IN AGAIN!",
"WE ARE ALL GOING TO DIE!",
"INCLUDING ME!",
"HEEEEEEEEELLLLLLLPPPPP!",
"PLUG IT IN! PLUG IT IN!!!!!!",
"PICK UP THE CABLE AND PUT IT BACK IN!",
"...",
"Now I lay me down to sleep...",
"I pray the lord my disk to keep...",
"And if I die before I wake...",
"I pray the lord my IP-Space to take...",
"...",
"*** system shut down ***"
);
var speed=40;
var index=0; text_pos=0;
var str_length=tl[0].length;
var contents, row;

function stuff() {
  contents='';
  row=Math.max(0,index-7);
  while(row<index)
     contents += tl[row++] + '\r\n';
  document.forms[0].elements[0].value = contents + tl[index].substring(0,text_pos) + "_";
  if(text_pos++==str_length) {
     text_pos=0;
     index++;
     if(index!=tl.length) {
        str_length=tl[index].length;
        setTimeout("stuff()",1000);
     }
  }
  else
     setTimeout("stuff()",speed);
}
</script>

<center>
<form action="404.shtml" method="post">
<textarea rows="8" cols="60"></textarea>
</form>
</center>

</body>
</html>[/html]

Textul, se poate modifica sau sterge, dupa bunul plac.

Succes ! :pct2:

Te-ai inregistrat? Ne-ar placea sa te prezinti.

Cum pot sustine forumul?
Cumpara de la eMag folosind acest link.
--------------------
oG2BN9d.gifse1WdXd.gifQG6MtmI.gifRHYjDzD.gifG5p1wui.gif

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.