Results 1 to 7 of 7

Thread: ErrorDocument 404

  1. #1
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,327 Times in 1,258 Posts

    ErrorDocument 404

    What happens when a visitor accesses a non-existent page on your web site?

    Do they get a generic 404 error that doesn't provide them with any useful information and makes them run away from your site?

    You can cause all 404 errors to send the visitor to your index page with a single line in your .htaccess file:

    Code:
    ErrorDocument 404 /
    Even better, you can send them to a custom error page with instructions specific to your site:
    Code:
    ErrorDocument 404 /404-not-found.html
    You can also use the ErrorDocument directive with other error codes, such as:

    • 401 (Unauthorized)
    • 403 (Forbidden)
    • 500 (Internal Server Error)
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  2. #2
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts
    I like the custom method the best. Creating a static copy of the home page and adding the content page not found or some appropriate text. This way it still has all the navigation and looks like a part of the site so they can easily search or go to another location.

    This way they will know why instead of just ending up at the main page. There is also a nice 404 script that can be added to these pages and will send you an email when someone hits a 404 on your site. Reports the page they were trying to visit so you can fix it or make a page to optimize these if you are getting a lot of them say from a dropped domain.

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  3. #3
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,327 Times in 1,258 Posts
    Quote Originally Posted by Mr.Bill View Post
    This way they will know why instead of just ending up at the main page. There is also a nice 404 script that can be added to these pages and will send you an email when someone hits a 404 on your site. Reports the page they were trying to visit so you can fix it or make a page to optimize these if you are getting a lot of them say from a dropped domain.
    That's an awesome idea! Got a URL?
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  4. #4
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts
    Sorry was looking for it was among the million other things on the external drive.
    This was a script that was done for one of my sites so it can be given free just dont resell it.

    Do not use this on a proxy site unless you want your mail box flooded
    Attached Files Attached Files

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  5. #5
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Posts
    5,033
    Blog Entries
    1
    Thanks
    1,010
    Thanked 2,327 Times in 1,258 Posts
    Awesome! Thanks man!
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  6. #6
    Shenron's Avatar
    Shenron is offline Administrator
    Join Date
    Dec 2008
    Location
    Portugal
    Posts
    1,900
    Blog Entries
    2
    Thanks
    561
    Thanked 548 Times in 368 Posts
    Typically I redirect all 404's to the homepage, but I guess I need to improve that.

  7. #7
    DomainMagnate's Avatar
    DomainMagnate is offline Super-Duper Moderator
    Join Date
    Dec 2008
    Posts
    749
    Blog Entries
    2
    Thanks
    150
    Thanked 175 Times in 110 Posts
    I redirect 404's to a special page with some text and ads

Tags for this Thread

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
  •