CSS font stacks & developer FAQs with Web standards
Site navigation below

WestNIC provides reliable web hosting services

Fastwebhost offers cheap web hosting & reseller hosting services

Web servers allow site managers to customise error pages for HTTP errors by number. This error 400 bad request, means that a request for a URL has been made but the server is not configured or capable of responding to it.

The most common reasons for a 400 bad request error occur with URLs that are handed-off to a servlet container where no default document or servlet is configured, or the HTTP request method is not implemented.

Apache custom error 400 configuration

For standard use, this custom error page can be configured with a single line in the .htaccess file for the relevant directory, as shown below. If this instruction is given in the root level directory, it applies to all subdirectories.

.htaccess

ErrorDocument 400 /error-docs/400.shtml
      

The file path must lead with a forward slash relative to the document root for the server or virtual host. In this example, error-docs is a sub-directory of the document root.

The custom error document itself should be a standard formatted HTML document that may use Server Side Includes or any other dynamic processing. Bear in mind, however, that if errors occur in the delivery of such dynamic documents your visitors may witness an even less friendly aspect to your site!

Activate .htaccess settings

To enable .htaccess files to override the server's http.conf settings, the default host must have the AllowOverride FileInfo property set in its Directory directive. Your configuration should look something like this:

<Directory "C:/apache/httpd/htdocs/manual">
    Options Includes Indexes FollowSymLinks MultiViews
    AllowOverride FileInfo
    Order allow,deny
    Allow from all
</Directory>
      

Server configuration problem?

If your Web server is issuing HTTP errors, you may find the answer to your problem in the following extract from our extensive FAQ section.

Article feedback

Your comments on this article will be appreciated, please use the form below to submit your views. If you would like a reply or article update notification, include your email address.

Information: Your email address will not be mis-used. If you include your address you may be sent a personal reply, you will not be added to any mailing list unless you request update notification. Read the site privacy statement for details.

What if you were One Percent Better? Ebooks for Web developers on iPad, Kindle, Nook and Sony Reader
Home · Web fonts · Font stacks · FAQs · Java · CSS · Javascript · HTML · Web manager