Home Contact Us Search

[ Order a Server ] [ Server Support ]


[ Getting Started ] [ Server Help ] [ Add on Help ] [ Solution ] [ Trouble Shooting ]

PLEASE NOTE, THIS IS VERY OLD ARCHIVE INFORMATION AND MAY NOT FUNCTION ON NEW SERVERS

[ DNS ] [ Email ] [ Server Admin ] [ Web Server ]

ErrorDocument Codes

Your Virtual Server has the capability to set custom error codes for either the complete server, or for individual subhosted domains. You can add these codes by making the following changes to your httpd.conf file located in your /usr/local/etc/httpd/conf directory.
  • In your httpd.conf file you will find a section like this:

    Making changes to your httpd.conf file in this section will make it "Server Wide" and all domains
    on your server will use these codes "unless" you specify the ErrorDocument Code in the individual <VirtualHost> entries.

    See below this for example of how to set it up for individual domain names.

    # Customizable error response (Apache style)
    # these come in three flavors
    #
    # 1) plain text
    #ErrorDocument 500 "Woah! 500 Internal Server Error! Stop that!! This script sucks!!
    # n.b. the (") marks it as text, it does not get output
    #
    # 2) local redirects
    #ErrorDocument 404 /404.html
    # to redirect to local url /missing.html
    #ErrorDocument 404 /cgi-bin/missing_handler.pl
    # n.b. can redirect to a script or a document using server-side-includes.
    #
    # 3) external redirects
    #ErrorDocument 401 "You simply do not know the password. Go away!
    #
  • You can change or add any of the codes you see below in the table to this section.
  • You may also add these individual ErrorDocument codes to your subhosted domain names like so:

    <VirtualHost mydomain.com www.mydomain.com>
    ServerName mydomain.com
    ServerAdmin webmaster@mydomain.com
    DocumentRoot /usr/local/etc/httpd/vhosts/mydomain.com/docs
    TransferLog /usr/local/etc/httpd/logs/mydomain.com_access_log
    ErrorLog /usr/local/etc/httpd/logs/mydomain.com_error_log
    ScriptAlias /cgi-bin/ /usr/local/etc/httpd/vhosts/mydomain.com/cgi-bin/
    ErrorDocument 400 /400.html
    ErrorDocument 401 /401.html
    ErrorDocument 402 /402.html
    ErrorDocument 403 /403.html
    ErrorDocument 404 /404.html
    </VirtualHost>

  • You can add as many custom error codes as you wish.  Below is a list of Codes you may wish to use.

 

Code Description Comment
100 Continue  
101 Switching Protocols  
200 OK Action complete successfully
201 Created Success following a POST command
202 Accepted The request has been accepted for processing, but the processing has not been completed.
203 Partial Information Response to a GET command, indicates that the returned meta information is from a private overlaid web.
204 No Content Server has received the request but there is no information to send back.
205 Reset Content  
206 Partial Content The requested file was partially sent.   Usually caused by stopping or refreshing a web page.
300 Multiple Choices  
301 Moved Permanently Requested a directory instead of a file.   The web server substituted the index.html file.
302 Moved Temporarily  
303 See Other  
304 Not Modified The cached version of the requested file is the same as the file to be sent.
305 Use Proxy  
400 Bad Request The request had bad syntax or was impossible to be satisfied.
401 Unauthorized User fail to provide a valid user name / password required for access to file / directory.
402 Payment Required  
403 Forbidden Access to a protected folder was attempted (i.e.) domain.com/cgi-bin
404 Not Found The requested file was not found.
405 Method Not Allowed  
406 Not Acceptable  
407 Proxy Authentication Required  
408 Request Time-Out  
409 Conflict   
410 Gone  
411 Length Required  
412 Precondition Failed  
413 Request Entity Too Large  
414 Request-URL Too Large  
415 Unsupported Media Type  
500 Server Error The server encountered an unexpected condition which prevented it from fulfilling the request
501 Not Implemented The server does not support the facility required.
502 Bad Gateway   
503 Out of Resources The server cannot process the request due to a system overload.  This (should) be a temporary condition.
504 Gateway Time-Out The service did not respond within the time frame that the gateway was willing to wait.
505 HTTP Version not supported

[ DNS ] [ Email ] [ Server Admin ] [ Web Server ]

PLEASE NOTE, THIS IS OLD ARCHIVE INFORMATION AND MAY NOT FUNCTION ON NEW SERVERS