Skip to content

A public page returns HTTP 204 and has no article content

Diagnose a public article route returning 204 No Content, separate page requests from API calls, and verify a real HTML response after fixing the handler.

By Crawlito · 6 min read

In short

  • A 204 response intentionally has no response content.
  • An API success response can be valid while the same behavior is wrong for a public article route.
  • Fix the route and verify the actual HTML body; changing only the status number is insufficient.
On this page

If a public article URL returns 204 No Content, the server is not delivering the article representation. Inspect which route, middleware, or edge rule produced that response, then restore the intended HTML response for a normal GET. Do not treat every successful status code as evidence that the page's answer was delivered.

A 204 can be appropriate for an API action that needs no response body. The defect is using that behavior where a visitor expects a document. Separate those purposes before changing shared application code.

Capture a normal document request

Save the headers and body from the exact public article URL:

bash
curl -sS -D page-headers.txt -o page-body.html \
  'https://www.example.com/guides/setup'
wc -c page-body.html

Use GET, as shown, rather than starting with a HEAD-only test. The body is central to this diagnosis.

MDN's 204 reference describes a successful response without content. That status does not carry the article you expected to read.

Check whether the request redirects before reaching the empty response. Record each relevant location and the final route rather than assuming the URL shown in the address bar identifies the handler.

The HEAD versus GET guide explains why a header-only probe cannot establish content delivery.

Keep the response sample and time. If a later request succeeds, the earlier evidence still helps identify a deployment, cache, or routing difference instead of reducing the incident to an unexplained screenshot.

Distinguish the page from its supporting API

Open the browser's Network panel and identify the document request separately from fetch requests, analytics calls, and API actions.

A successful 204 from a tracking endpoint may be entirely expected. It does not explain a missing article unless the application mistakenly depends on response content that the endpoint never promises to return.

Likewise, a document can return 200 while a data request fails later. That is a different path from the public document itself returning 204.

Make a short request map:

RequestIntended resultObserved evidence
Article documentHTML with the answerStatus and body
Content APIDocumented data representationStatus and payload
Completion actionDefined success responseAccepted operation
Telemetry endpointIts documented contractSeparate measurement result

The map keeps harmless empty responses out of the incident scope and identifies the request that actually needs content.

Do not change all 204 responses across the application. The repair should preserve valid API behavior while restoring the document route.

Trace the response to its owner

Inspect route matching, middleware, reverse-proxy rules, and edge handlers. Look for an early return that ends the document request before its renderer runs.

A catch-all rule may have been copied from an API route. A conditional branch may return nothing when content is missing. A security or maintenance layer may also generate its own response.

Use request identifiers and application logs to connect the public observation with the relevant handler. Do not infer the owner solely from a generic Server header.

Compare a working neighboring article with the failing route. If only one slug fails, inspect its content lookup and publication state. If an entire folder fails, review the shared routing boundary first.

The HTTP status guide provides the broader response context, but the fix here requires identifying the concrete code path that emitted 204.

Preserve authorization requirements on routes that are actually private. A public article repair does not justify exposing account or administrative endpoints.

Reproduce the branch with a controlled example

Use a known published article and a deliberately nonexistent slug in a test environment or other approved test path. Write down the expected result for each.

The published article should deliver its intended document. The nonexistent slug should follow the site's defined missing-page behavior, rather than being converted into an empty successful response.

If a request header or parameter selects the failing branch, vary one input at a time. Save the complete request shape so another developer can reproduce it.

Avoid using a crawler user-agent override as the only test. A request from your machine with a different string does not establish how the actual crawler reaches the service.

For a content lookup bug, log a non-sensitive record identifier and the chosen response branch. That is usually more useful than logging full page bodies or visitor data.

Once the triggering condition is known, keep it as a focused regression case. The test should demonstrate the response contract, not merely assert that a particular line of code exists.

Repair the document response and missing-page behavior

Change the responsible handler so that a successful public document request returns the intended HTML and appropriate metadata.

Changing 204 to 200 while leaving an empty body does not restore the page. It can conceal the original status symptom while readers still receive no answer.

For genuinely missing content, return the site's defined missing response instead of fabricating a successful article. The soft 404 guide explains why response status and meaningful content need to agree.

Check content-type handling as well. A JSON object containing the article is not the same response as a readable HTML document at the public article address.

If a cache contains the old empty response, follow the delivery platform's scoped recovery process after repairing the origin. Avoid broad invalidations before confirming that the source now produces the right content.

Deploy the change through the normal workflow and preserve the intentionally empty API actions you identified earlier.

Verify the answer and the reader's next step

Repeat the original GET and confirm the actual article text. Check a distinctive sentence near the beginning and another later in the document.

Then open the URL directly in a fresh browser session. Confirm that the heading, navigation, and relevant action are usable, not just present in a source file.

Follow an internal link to the article as a separate test. Direct entry and client navigation can exercise different application paths.

Review the canonical URL and indexing directives in the delivered document. Restoring the body does not automatically correct unrelated metadata that may have been generated by the same route.

Test the missing-slug control again. A repair that turns every request into the same article can create a new routing problem.

Keep a concise acceptance record with the final status, body evidence, public URL, and tested release. This proves restoration of the document without making unsupported claims about indexing speed.

Report the effect without inventing a crawler rule

Describe the observed failure precisely: the public article GET returned 204 and no article content; the repaired route now delivers the intended document.

Do not claim that every 2xx status is equivalent for indexing, or that every AI system handles an empty document identically. The immediate evidence is simpler: the answer was absent from the tested response.

If historical logs are available, review the affected route and period to estimate the scope of empty responses. Label gaps in that evidence rather than inventing a traffic loss.

For future releases, include a body assertion for a representative article alongside status checks. A monitor that accepts any successful status can miss this specific defect.

After the public response is repaired, allow later search and crawler observations to answer their own questions. Working delivery is a prerequisite you can verify; citation outcomes are outside this test.

Frequently asked questions

Is HTTP 204 always an error?

No. It is valid for operations whose successful response has no content. A public article needs a document representation, so inspect the route's intended purpose.

Will changing the status to 200 solve the problem?

Only if the response also delivers the correct article. A successful number with an empty or unrelated body does not fix the reader's experience.

Should I remove every empty API response?

No. Preserve documented API contracts and repair the specific request that is supposed to return a page.

Run the repaired article through the free Crawlito check to inspect its current public response and page-level signals.

Filed under Access and robots.txt. Topics: http-status, troubleshooting, rendering