about me

Download RC3 | Function Database | Online Manual

I recommend SiteGround web hosting

Author
Topic: Add a 404 Not Found to your forum using your portal  (Read 781 times)

0 Members and 2 Guests are viewing this topic.

Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Add a 404 Not Found to your forum using your portal
« on: July 03, 2010, 02:41:08 PM »
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:

Code: [Select]
<table cellspacing="1" cellpadding="1" border="0" align="" width="100%" summary="">
    <tbody>
        <tr>
            <td style="text-align: center;"><img src="http://www.chevyavalancheclub.com/images/106189-3d-glossy-orange-orb-icon-signs-no-walking1.png" alt="Page Not Found" /></td>
            <td style="text-align: center;"> <br />
            <font size="3"><span style="color: #4265a7; font-weight: bold;">Wow you found it!! </span></font><br /><br />
            I've been looking for this page since i created it in 2009. <br />
            Sadly, even though you found this page, I seem to have <br />
            also misplaced the page you were looking for.<br />
<script type="text/javascript">
  var GOOG_FIXURL_LANG = 'en';
  var GOOG_FIXURL_SITE = 'http://www.bluedevilcustoms.com'
</script> <script type="text/javascript"
  src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js">
</script></td>
        </tr>
    </tbody>
</table>

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

Open your .htaccess file and add:

Code: [Select]
ErrorDocument 404 http://www.bluedevilcustoms.com/index.php/page,page585.html
Replace the link with the link of your own 404 not found page.

Demo: http://www.bluedevilcustoms.com/index.php/page,page585.html
« Last Edit: July 03, 2010, 02:42:59 PM by bluedevil »

Offline Dismal Shadow

  • Jr Member
  • ***
  • Joined: 02.12.10
  • Posts: 44
  • Gender: Male
  • This wretched world does not reward endeavor
    • Two Worlds
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #1 on: July 03, 2010, 08:44:53 PM »
Nice but mine doesn't seem to redirect to the error page.

.htaccess  ErrorDocument 404 http://www.thetwoworldsforum.com/index.php?page=error404

Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #2 on: July 03, 2010, 09:19:11 PM »
Will look later,  I'm on my phone and all see is your forum with the iPhone theme/mod.

Offline Dismal Shadow

  • Jr Member
  • ***
  • Joined: 02.12.10
  • Posts: 44
  • Gender: Male
  • This wretched world does not reward endeavor
    • Two Worlds
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #3 on: July 04, 2010, 02:34:37 AM »
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. :)

Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #4 on: July 04, 2010, 11:41:05 AM »
Very well DS.

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




Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #5 on: July 06, 2010, 02:17:17 PM »
DS, i cant read your post, its blank.

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

Offline Dismal Shadow

  • Jr Member
  • ***
  • Joined: 02.12.10
  • Posts: 44
  • Gender: Male
  • This wretched world does not reward endeavor
    • Two Worlds
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #6 on: July 06, 2010, 02:28:01 PM »
DS, i cant read your post, its blank.

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

Quote
Hey 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..

Code: [Select]
<html>
<head>
<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?",
 
"*sigh*",
 
"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.*",
 
"Hmm.",
 
"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?",
 
"Hmm.",
 
"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.",
 
"Augh!",
 
"Hey...",
 
"Maybe I could interest you in another page, eh?",
 
"There are tons around here that are pretty cool, actually.",
 
"Yeah.",
 
"Go explore.",
 
"Have fun.",
 
"Now.",
 
"Seriously.",
 
"You'd better go on now.",
 
"Please leave me to my thoughts.",
 
"And my dreams.",
 
"Yeah."
 
);
 
var speed=60;
 
var index=0; text_pos=0;
 
var str_length=tl[0].length;
 
var contents, row;
 
 
 
function type_text()
 
{
 
  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("type_text()",1500);
 
    }
 
  } else
 
    setTimeout("type_text()",speed);
 
 
 
}
 
//--></script>

 
 
<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>
 
<table style="font-family: Helvetica,Arial,sans-serif;" align="center" border="0" cellpadding="10" cellspacing="0" width="753">
 
</table>
 
<div style="font-family: Helvetica,Arial,sans-serif;" align="center"><big><b>Error
404<br>
 
 </b></big><br>
 
<b>The page you are trying to look for
was not found!<br>
 
<br>
 
</b> <>
 
 <center style="font-family: Helvetica,Arial,sans-serif;">
<form> <textarea rows="8" cols="60" wrap="soft"></textarea> </form>
 
 </center>
 
 <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">
 
<tbody>
 
<tr>


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


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

</body> </html>
« Last Edit: July 09, 2010, 10:44:51 AM by Delita Heiral »

Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #7 on: July 06, 2010, 02:29:40 PM »
That's odd, I still can't read your post.  Hmmm..

Offline Dismal Shadow

  • Jr Member
  • ***
  • Joined: 02.12.10
  • Posts: 44
  • Gender: Male
  • This wretched world does not reward endeavor
    • Two Worlds
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #8 on: July 09, 2010, 01:04:18 AM »
Still can't see my post?

Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #9 on: July 09, 2010, 06:30:22 AM »
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.

Offline Dismal Shadow

  • Jr Member
  • ***
  • Joined: 02.12.10
  • Posts: 44
  • Gender: Male
  • This wretched world does not reward endeavor
    • Two Worlds
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #10 on: July 09, 2010, 10:46:46 AM »
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

Offline bluedevil

  • Admin
  • Full Member
  • *****
  • Joined: 11.28.09
  • Posts: 165
  • Gender: Male
    • ChevyAvalancheClub.com
  • SMF Version: RC3
Re: Add a 404 Not Found to your forum using your portal
« Reply #11 on: July 10, 2010, 10:44:44 AM »
Cool script man, but i dont see the problem?

http://www.bluedevilcustoms.com/index.php/page,page758.html

 



SMF RC3 Now Available for Download

Simple Machines Forum is a free, professional grade software package that allows you to set up your own online community within minutes...

Download...

SimpleDesk finally for SMF

SimpleDesk provides a fully integrated ticket based help desk solution, with the capability to have the forum and have full ticket to topic and back functionality...

Download...

Google Directions Map for SMF RC3

This mod installs a directions page to your SMF forum with a directions map provided by google. Useful to those forum owners that offer gas, travel, hotels, trips services...

Download...

Facebook Look-a-like theme for RC3

Get the look and feel of Facebook right in your SMF forum. Very simple to the eyes, it uses Curve theme layout...

Download...

Updates
Stay up to date with the latest bdc mods via Email, RSS, Twitter or Facebook.
bdc Members

52



Total Mods

14