# 400 Bad Request in Apache httpd

> Find which Apache check returned 400: header size and count limits, malformed URLs or Host headers, strict protocol parsing. Tested on Apache 2.4.62.

Canonical: https://scaplet.com/errors/http/400/apache

Guide Error · HTTP status codes

Find which Apache check returned 400: header size and count limits, malformed URLs or Host headers, strict protocol parsing. Tested on Apache 2.4.62.

3 min

read

2

sources

Oct 31, 2026

updated

Scaplet Editorial Team

author

400 4xx · Client error

The short answer

Apache httpd returns 400 when it cannot accept the request as sent. Tested on Apache 2.4.62: an oversized header, too many headers, a bad percent-encoded path and a malformed Host header each returned 400, while an oversized request line returned 414. The error log line names the check that fired.

1. [Which Apache check returned the 400](#which-apache-check-returned-the-400)
2. [Reproduce and check it in 2 minutes](#reproduce-and-check-it-in-2-minutes)
3. [Fixes by cause](#fixes-by-cause)
4. [What it means for SEO and crawlers](#what-it-means-for-seo-and-crawlers)

30-second check

## Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F400%2Fapache%20(%22400%20Bad%20Request%20in%20Apache%20httpd%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F400%2Fapache%20(%22400%20Bad%20Request%20in%20Apache%20httpd%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F400%2Fapache%20(%22400%20Bad%20Request%20in%20Apache%20httpd%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Ferrors%2Fhttp%2F400%2Fapache%20(%22400%20Bad%20Request%20in%20Apache%20httpd%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

_01_What each bad request returned on Apache 2.4.62

## Which Apache check returned the 400

Apache rejects a request before any of your content is involved, so the cause is almost always in the bytes the client sent. I ran Apache 2.4.62 locally with deliberately small limits (`LimitRequestFieldSize 100`, `LimitRequestFields 5`, `LimitRequestLine 200`) and sent one bad request per row. The log lines are the real ones at `LogLevel debug`.

Request sent

### One header longer than the field limit

Status

400

Error log line (abridged)

AH00561: Request header exceeds LimitRequestFieldSize

Request sent

### More headers than the field-count limit

Status

400

Error log line (abridged)

AH00563: Number of request headers exceeds LimitRequestFields

Request sent

### Request line longer than the line limit

Status

414

Error log line (abridged)

AH00565: request failed: client's request-line exceeds LimitRequestLine

Request sent

### Path with a bad escape, `/%zz`

Status

400

Error log line (abridged)

AH10244: invalid URI path (/%zz)

Request sent

### Host header containing a space

Status

400

Error log line (abridged)

AH00550: Client sent malformed Host header

The surprise is the third row. An over-long URL is not a 400 here; it is a [414](/errors/http/414). The Apache docs for these directives say what the limits are, not which status each one produces, so treat the table as an observation from this version rather than a guarantee for every build.

The same directives carry these defaults in the docs: `LimitRequestFieldSize` 8190 bytes, `LimitRequestFields` 100 and `LimitRequestLine` 8190 bytes. The docs also note that SPNEGO authentication headers can be up to 12392 bytes, which is why Kerberos sites hit the field-size limit first.

_02_Check it

## Reproduce and check it in 2 minutes

Start with a public Apache site. This sends a path with an invalid escape to `httpd.apache.org`, which answered 400 when I ran it:

The same server answered 414 to a 9,000-character path and 200 to a 9,000-byte header, so its limits differ from the small test values above. Now check your own server. These commands need your host and port; replace `example.test`:

Your own server: three requests, three different checks

```
# 1. Header bigger than LimitRequestFieldSize (default 8190 bytes) curl -s -o /dev/null -w "%{http_code}\n" -H "X-Pad: $(head -c 9000 /dev/zero | tr '\0' a)" http://example.test/ # 2. Malformed Host header curl -s -o /dev/null -w "%{http_code}\n" -H "Host: bad host" http://example.test/ # 3. Invalid escape in the path curl -s -o /dev/null -w "%{http_code}\n" --path-as-is "http://example.test/%zz" # Expect: 400 for each on a default config; then read the error log
```

Then run `grep -E 'AH00561|AH00563|AH10244|AH00550' error.log`. If the log shows nothing, raise `LogLevel` to `info` for core, because the header-limit lines above were written at info level in my test.

Public Apache server: a bad percent escape

```
curl -s -o /dev/null -w "%{http_code}\n" --path-as-is "https://httpd.apache.org/%zz" # Observed: 400
```

_03_Cause, signal and the fix

## Fixes by cause

Cause

### Cookies or auth headers over the limit

Signal

AH00561

Fix

Shrink the cookie or token; raise `LimitRequestFieldSize` only if the client cannot change

Cause

### Many headers from a proxy chain

Signal

AH00563

Fix

Remove duplicate headers upstream before raising `LimitRequestFields`

Cause

### Client sends raw or double-encoded URLs

Signal

AH10244

Fix

Fix the client's URL encoding; the server is right to refuse

Cause

### Hostname not in `ServerName` or `ServerAlias`

Signal

400 only with `StrictHostCheck On`

Fix

Add the name to the virtual host

Cause

### A tool sends bare line feeds

Signal

400 in the default `Strict` mode

Fix

Make the tool send CRLF; `openssl s_client` needs `-crlf`

The field-size limit is allowed in server config and virtual host context. The Apache docs say that under normal conditions you should not change the default. If you must, raise it by the amount you measured, not to a round large number:

httpd.conf: allow bigger headers for a Kerberos site

```
# Default is 8190. SPNEGO headers can reach 12392 bytes per the Apache docs. LimitRequestFieldSize 16384
```

The strict parser is the other lever. `HttpProtocolOptions` defaults to `Strict LenientMethods Allow0.9`, and the docs warn strongly against `Unsafe` on public servers. If a legacy monitoring tool on an internal network cannot be fixed, scope the relaxation to one virtual host that serves only that network:

Relax strict parsing for one internal virtual host only

```
<VirtualHost 10.0.0.5:8080> ServerName monitor.internal.example HttpProtocolOptions Unsafe </VirtualHost>
```

**Placement matters**The docs say these rules are applied before request processing, so they must be configured at the global level or in the first matching virtual host for the IP and port, not by name. A directive in a later name-based host may be ignored.

_04_Explained

## What it means for SEO and crawlers

Google's documentation says it does not index URLs that return a 4xx [status code](/glossary/http-status-codes) and drops already-indexed URLs that start returning one, and that 4xx codes other than 429 do not change the crawl rate. A header-limit 400 usually depends on a client's cookies, so [Googlebot](/ai-crawlers/googlebot) often does not see it. A 400 on a clean request to a public URL is the case to fix: request it with `curl` and no cookies and read the log line. See also [400 on nginx](/errors/http/400/nginx) and [413 on Apache](/errors/http/413/apache).

Sources · 2

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- apache.org
- google.com

1. 01 [Apache HTTP Server 2.4: core features (LimitRequest directives, HttpProtocolOptions, StrictHostCheck)](https://httpd.apache.org/docs/2.4/mod/core.html) httpd.apache.org · checked 2026-11-01
2. 02 [How HTTP status codes affect Google's crawlers](https://developers.google.com/search/docs/crawling-indexing/http-network-errors) developers.google.com · checked 2026-11-01

Questions

## Asked a lot.

2 questions people ask next, answered from the sources on this page.

_01_ Why did my long URL return 414 instead of 400?

On Apache 2.4.62 a request line over LimitRequestLine produced 414 in my test, while an oversized header produced 400. Check the error log line to see which limit fired.

_02_ Where does Apache say why it returned 400?

In the error log. Lines such as AH00561, AH00563, AH10244 and AH00550 name the failed check, and a debug-level log adds the protocol detail.

## Keep learning

[All errors](/errors)

[Learn 400 Bad Request in nginx HTTP status codes](/errors/http/400/nginx) [Related 4xx errors Status codes and links](/seo-issues/4xx-errors) [Read next HTTP 400 Bad Request HTTP status codes](/errors/http/400) [Do Run a free site audit Free, about two minutes](/site-audit)

Other 400 errors
[400 Bad Request in Spring Boot](/errors/http/400/spring-boot) [CloudFront 400: Bad Request](/errors/cdn/cloudfront-400) [HTTP 400 Bad Request](/errors/http/400) [400 Bad Request in Chrome](/errors/http/400/chrome) [400 Bad Request in Django](/errors/http/400/django)

Nearby in errors
[HTTP 308 Permanent Redirect](/errors/http/308)

More in HTTP 400 Bad Request
[400 Bad Request in Apache httpd](/errors/http/400/apache) [400 Bad Request in Chrome](/errors/http/400/chrome) [400 Bad Request in Django](/errors/http/400/django) [400 Bad Request in Flask](/errors/http/400/flask) [400 Bad Request in nginx](/errors/http/400/nginx) [400 Bad Request in Spring Boot](/errors/http/400/spring-boot)

Terms on this page
[HTTP status codes](/glossary/http-status-codes)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

Run the free audit, then approve the fixes. Every change can be undone.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
