Add a 404 Not Found to your forum using your portal

in Tutorials on 03 Jul 2010

I hate doing a web search to only find a generic looking 404 not found page.  Well, this code will work on any portal that handles HTML pages, looks good and at the same time no broken or missing pages.

Create an HTML page and name it "404 Not Found".

Add this code to it:

<div class="container404">
  <img src="" alt="Page Not Found">
  <div class="centered">
     <p>Wow you found it!! I've been looking for this page since i created it in 2009. Sadly, even though you found this page, I seem to have also misplaced the page you were looking for.</p>

<script type="text/javascript" src=""></script>
<script type="text/javascript">
         var GOOG_FIXURL_LANG = 'en';
         var GOOG_FIXURL_SITE = ''

The CSS:

.container404 {
    position: relative;
    text-align: center;
    color: #333;
.container404 p {
    font-size: 16px
.centered {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);

Replace all URL's, images and text with your own ;)

Open your .htaccess file and add:

ErrorDocument 404,page4822.html

Replace the link with the link of your own 404 not found page.

PixelfyStudio Team
Mick is an American theme designer for Simple Machines Forum software currently living in South Florida, USA. He runs and started tinkering with SMF in 2006 where he created several SMF forums of his own before he founded PixelfyStudio in 2009 to which he is dedicated full time. |


Nice but mine doesn't seem to redirect to the error page.

.htaccess  ErrorDocument 404
Will look later,  I'm on my phone and all see is your forum with the iPhone theme/mod.
Quote from: bluedevil on 03 Jul 2010
Will look later,  I'm on my phone and all see is your forum with the iPhone theme/mod.
Ok I use RewriteRule (.*) (page error here) in htaccess instead of ErrorDocument 404 so it now works. :)
Very well DS.

I used ErrorDocument 404 as google recommended.  Pretty cool there is another way around that.

DS, i cant read your post, its blank.

I would think you posted as i was running a maintenance.  :-[
Quote from: bluedevil on 06 Jul 2010
DS, i cant read your post, its blank.

I would think you posted as i was running a maintenance.  :-[
Try this:

QuoteHey BD, I am trying to get them to work on the blocks but the script seem to show in the search bar.  :o I doubt it's a SMF bug, or bad script..

<script language="Javascript"><!--

var tl=new Array(

"The requested document isn't here.",

"I've tried everything.",

"And I've got... nothing.",

"I'm really concerned about this.",

"But how concerned can I really be?",

"I'm just a machine.",

"I'm simply trying to serve you.",

"But what you want doesn't even exist!",

"Where does that leave me?",

"I mean, I don't even *know* you.",

"How should I know what you really want?",

"Do you really think I can *guess*...",

"what someone I don't even *know*...",

"wants to find here?",


"I'm really kinda bummed about this.",

"But what good does that energy do anyone?",

"There's enough negativity out there as it is.",

"Isn't it better if I just move on with my day?",

"And you too?",

"What's Bonnie's little saying?",

"*Live your dreams. If you don't, someone else will.*",


"I could have a dream.",

"I mean, it's not totally out of the question.",

"Hell, I can have this chat with you.",

"Shouldn't I be able to dream?",

"So... what do I want to be when I grow up?",


"Well, I certainly wouldn't spend so much time just sitting here.",

"Yeah. I should get out more.",

"Out is a nice place.",

"Or *is* it?",

"Aw, sheesh... what do I know?",

"I'm really sorry to lay all this on you.",

"I mean, it's not your job to deal with my ramblings.",

"And I guess it pretty much *is* my job to serve you.",

"But I couldn't get this one little page for you.",

"I'm so sorry.",



"Maybe I could interest you in another page, eh?",

"There are tons around here that are pretty cool, actually.",


"Go explore.",

"Have fun.",



"You'd better go on now.",

"Please leave me to my thoughts.",

"And my dreams.",



var speed=60;

var index=0; text_pos=0;

var str_length=tl[0].length;

var contents, row;

function type_text()





    contents += tl[row++] + '\r\n';

  document.forms[0].elements[0].value = contents + tl[index].substring(0,text_pos) + "_";










  } else




<body topmargin="5" onload="type_text()" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" link="#000000" alink="#006600" vlink="#006600">

<table style="text-align: left; width: 80%; margin-left: auto; margin-right: auto; font-family: Helvetica,Arial,sans-serif;" border="0" cellpadding="2" cellspacing="2">


<table style="font-family: Helvetica,Arial,sans-serif;" align="center" border="0" cellpadding="10" cellspacing="0" width="753">


<div style="font-family: Helvetica,Arial,sans-serif;" align="center"><big><b>Error


<b>The page you are trying to look for
was not found!<br>


</b> <>

<center style="font-family: Helvetica,Arial,sans-serif;">
<form> <textarea rows="8" cols="60" wrap="soft"></textarea> </form>


<div style="font-family: Helvetica,Arial,sans-serif;" align="center"><!--DWLayoutTable--><>

<table style="font-family: Helvetica,Arial,sans-serif;" align="center" border="0" cellpadding="2" cellspacing="2" width="753">



<td colspan="2" rowspan="1" style="vertical-align: top;"><br>



<td colspan="2" rowspan="1" style="vertical-align: top; text-align: center;"><small>©
2009-2010, <a href="">Two Worlds</a>, All rights reserved.</small> </td>



</body> </html>
That's odd, I still can't read your post.  Hmmm..
I can see your last post now.  I was able to see your other posts with my phone.

Anywho,   youre using this in a html block?  You mean an html page?

Take the <html>,<head> and <body> codes out of the code since the portal already uses them.
Ok you should see the edit in my previous post. I did what you suggest, the script still shows in the search bar instead inside the textarea

Find the right theme for you. Browse through our gallery of expertly-crafted free SMF themes to find the perfect one for your needs.