TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 28, 2024, 08:41:37 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,104
  • Total Topics: 21,212
  • Online today: 176
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 1
  • Guests: 188
  • Total: 189
  • illori

[Tip] Create a 404 Not Found Page

Started by bluedevil, April 13, 2010, 08:55:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mick

[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....
<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:
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.
<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>

Freddy

Excellent tip BD  O0

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

Chair


Mick

Thanx  ;)   Very easy to do, fast, accurate and at least it will keep guests in your site.

WillyP


ZarPrime

Great Tip Mick. O0 I've seen ways to do this before but yours is about the easiest I've seen.  Good Job.

ZarPrime

Ken.

Good page Mick. :up:

Gonna have to use this one.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

william777

Thanks BD. I have an existing one but your is better. I will use it.

Mick

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.

Ken.

" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.