Changing error page

Discussion in 'HTML & Website Design' started by terminator69, Dec 24, 2007.

  1. #1
    I've heard you can have a custom error page for a site, how easy is this to do? I run a file hosting site and occasionally the ram will be overloaded and the site will show a "403 forbidden" error until server is restarted. So how easily is this done?
     
    terminator69, Dec 24, 2007 IP
  2. AYCOM

    AYCOM Peon

    Messages:
    33
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'll need to modify your .htaccess file (located in the same place as the web sites index.html or index.php file) and add the following lines to it:

    ErrorDocument 403 http://www.domain.com/403error.html
    ErrorDocument 404 http://www.domain.com/404error.html

    Of course those URLs need to point to your actual error pages that you create.

    If you don't already have a .htaccess file then just create one on your hard drive called htaccess.txt and enter the lines above. Then you need to save it, rename it to .htaccess, and upload it via FTP to the sites main directory (where the index file is).

    --------------------------------------------------------------
    AYCOM Consulting - Mid to High-End Web Development
     
    AYCOM, Dec 24, 2007 IP
  3. WebGeek182

    WebGeek182 Active Member

    Messages:
    510
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    95
    #3
    Also important to note...The only thing with custom error pages is that you need to make sure they serve the proper headers with 404,403, etc, for search engines. You can do this through PHP placed at the beginning of your file. Also with ASP and other languages.
     
    WebGeek182, Dec 24, 2007 IP