Results 1 to 2 of 2

Thread: How to Set Up A Custom 404 File Not Found Page

  1. #1
    Nicky s's Avatar
    Nicky s is offline Moderator
    Join Date
    Jan 2010
    Location
    UK - GrowaDollar
    Posts
    227

    Default How to Set Up A Custom 404 File Not Found Page

    this is such an easy mod but can finish your site off.

    what is a 404 error page?
    The 404 or Not Found error message is a HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested. 404 errors should not be confused with "server not found" or similar errors, in which a connection to the destination server could not be made at all. A 404 error indicates that the requested resource may be available again in the future.

    all hosting companys give you one but most of the time they are filled with ads and dont look anything like your site.

    so how do we make one?

    its very easy we are going to need to edit 2 files

    first off you need to edit your .htaccess file which is in the root of your domain on your server

    add this to your .htaccess file
    Code:
    ErrorDocument 404 /notfound.html
    Please not the notfound.html URl is the url to the page that will be showen when a 404 error happens. you can change this to what ever you want.

    next we need to make the page that will be showen (save as notfound.html or what ever you wish to name it as long as its the same as what is in your .htaccess file)
    Code:
    <!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>Untitled Document</title>
    </head>
    
    <body>
    <p>404 error </p>
    <p>sorrie page not found 
    </p>
    </body>
    </html>
    upload to server and you are done

    to see it working try and visit a url you know dose not exisit on your server

    To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

  2. #2
    Rocketeer's Avatar
    Rocketeer is offline Member
    Join Date
    Jan 2011
    Location
    USA
    Posts
    30

    Default

    Code:
    <a href="javascript:history.go(-1)">Return to the previous page</a>
    You could also use this to provide an easy link to return to the previous page.

    I also include a searchbox and sitemap on my 404 pages, but those are a step above beginner status.

Similar Threads

  1. On Page SEO
    By Silver in forum Search Engine Optimization
    Replies: 2
    Last Post: 12-14-2011, 06:35 AM
  2. On-Page Optimization vs. Off-Page Optimization
    By lamposproject in forum Search Engine Optimization
    Replies: 15
    Last Post: 11-28-2011, 09:06 AM
  3. Replies: 19
    Last Post: 01-06-2011, 06:14 AM
  4. What File Hosting Do You Use
    By Nicky s in forum Hosting
    Replies: 9
    Last Post: 01-06-2011, 05:34 AM
  5. Why we use html and htm file types
    By Silver in forum Coding
    Replies: 3
    Last Post: 01-06-2011, 05:16 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •