News: April 7th, 2019, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.3! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

June 18, 2019, 02:55:20 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188435
  • Total Topics: 20727
  • Online Today: 25
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 19
Total: 19

Author Topic: [Tip] Create a 404 Not Found Page  (Read 19976 times)

0 Members and 1 Guest are viewing this topic.

Offline Mick

  • Sr. Member
  • ****
  • Posts: 318
  • I use SMF 2.0.15
    • idesignSMF.com
[Tip] Create a 404 Not Found Page
« on: April 13, 2010, 01:55:10 PM »
[Tip] Create a 404 Not Found Page

Your visitors may stumble into a 404 "Not found" page on your website for a variety of reasons:

    * A mistyped URL, or a copy-and-paste mistake
    * Broken or truncated links on web pages or in an email message
    * Moved or deleted content

Confronted by a 404 page, they may then attempt to manually correct the URL, click the back button, or even navigate away from your site.

This code will actually show your forum and let them know that your forum does exists and make them to at least try again.

-Create a HTML page and name "404 Not Found".
-Use frame style from theme.
-Uncheck everything except  "Display Title".
-Do not make it Sticky or Toggle to Front Page.

Add this code to the page....
Code: [Select]
<script type="text/javascript">
  var GOOG_FIXURL_LANG = 'en';
  var GOOG_FIXURL_SITE = 'http://www.yoursite.com'
</script> <script type="text/javascript" src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js">
</script>

-Replace yoursite.com with the actual URL of your forum.
-Activate and use the magnifying glass to preview.
-Grab the URL from your browser and copy.

Open your .htaccess file and add:
Code: [Select]
ErrorDocument 404 http://URL OF THE PAGE GOES HERE-Replace http:/URL OF THE PAGE GOES HERE with the URL of your 404 created page.

That's it.   Now go ahead and misspell a URL in your forum to see the newly "404 Not Found" Page.

Demo: http://www.chevyavalancheclub.com/index.php/page,426.html

If you want to get fancy, you can add a message....

This one is my actual code,..... feel free to save the image if you like.  I only ask not to hot link it.  Save it to your own server.

Get cool icons here: http://icons.mysitemyway.com/

Replace the image with your own path and re-write message.
Code: [Select]
<table cellspacing="1" cellpadding="1" border="0" align="" width="100%" summary="">
    <tbody>
        <tr>
            <td style="text-align: center;"><img src="http://yourimage.png" alt="Page Not Found" /></td>
            <td style="text-align: center;"> <br />
            <font size="3"><span style="color: rgb(255, 0, 0); font-weight: bold;">Wow you found it!! </span></font><br /><br />
            I've been looking for this page since i created it in 2006. <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.yoursite.com'
</script> <script type="text/javascript"
  src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js">
</script></td>
        </tr>
    </tbody>
</table>
« Last Edit: April 13, 2010, 02:07:52 PM by bluedevil »

Offline Freddy

  • Code
  • *
  • Posts: 1615
    • AiDreams
Re: [Tip] Create a 404 Not Found Page
« Reply #1 on: April 13, 2010, 02:02:31 PM »
Excellent tip BD  O0

I had been thinking about custom error pages lately, now I know how :)

Chair

  • Guest
Re: [Tip] Create a 404 Not Found Page
« Reply #2 on: April 13, 2010, 02:03:54 PM »
LOL very nice bluedevil :P

Offline Mick

  • Sr. Member
  • ****
  • Posts: 318
  • I use SMF 2.0.15
    • idesignSMF.com
Re: [Tip] Create a 404 Not Found Page
« Reply #3 on: April 13, 2010, 02:10:41 PM »
Thanx  ;)   Very easy to do, fast, accurate and at least it will keep guests in your site.

Offline WillyP

  • Support Team
  • *
  • Posts: 769
    • Planet Descent
Re: [Tip] Create a 404 Not Found Page
« Reply #4 on: April 13, 2010, 02:16:41 PM »
Great tip, thanks for sharing!

Offline ZarPrime

  • Friends
  • *
  • Posts: 4653
Re: [Tip] Create a 404 Not Found Page
« Reply #5 on: April 13, 2010, 02:55:03 PM »
Great Tip Mick. O0 I've seen ways to do this before but yours is about the easiest I've seen.  Good Job.

ZarPrime

Offline Ken.

  • Support Team
  • *
  • Posts: 4342
    • Our FamilyForum
Re: [Tip] Create a 404 Not Found Page
« Reply #6 on: April 13, 2010, 03:07:45 PM »
Good page Mick. :up:

Gonna have to use this one.

----------------------------------------------------
" If everything seems under control, you’re not going fast enough." - Mario Andretti  ^-^

Offline william777

  • Full Member
  • ***
  • Posts: 122
Re: [Tip] Create a 404 Not Found Page
« Reply #7 on: April 13, 2010, 03:33:18 PM »
Thanks BD. I have an existing one but your is better. I will use it.

Offline Mick

  • Sr. Member
  • ****
  • Posts: 318
  • I use SMF 2.0.15
    • idesignSMF.com
Re: [Tip] Create a 404 Not Found Page
« Reply #8 on: April 13, 2010, 03:38:35 PM »
Hey thanx guys,..... i've always used the google code but i wanted to add a fancy image and a message.

I thought i'd share ;)  Glad y'all found useful.

Offline Ken.

  • Support Team
  • *
  • Posts: 4342
    • Our FamilyForum
Re: [Tip] Create a 404 Not Found Page
« Reply #9 on: April 13, 2010, 05:55:10 PM »
Here's mine, it's very much like yours.  O0

http://www.ourfamilyforum.org/FamilyForum/index.php?page=208

----------------------------------------------------
" If everything seems under control, you’re not going fast enough." - Mario Andretti  ^-^