Blog / Technical SEO /
Finding pages served with unexpected content types
You click a link to an article. Instead of a page, your browser downloads a mystery file. Or it shows you a wall of raw HTML.
The URL looks fine. So the real question is: what is the server actually sending?
Content-type problems can come from server config, application routes, a proxy, a file extension or a cache. Inspect one failing response first. Don’t edit a global setting that might affect hundreds of pages.
Confirm the response
Record the affected URL, time, browser and expected behaviour. Use browser developer tools or an HTTP inspection tool to review the status code, response headers and body. Check whether the content type matches what the resource actually contains. A page request and a downloadable file have different expected behaviour.
Test in a clean session and, if possible, from a second network or tool. A browser extension, local cache or service worker may affect what you see. I always check in a private window before I believe anything. Keep the conditions consistent so the comparison is useful.
Compare the failing URL with a working page of the same type. Look for differences in hostname, path, file extension, response status and headers. If only one route is affected, the cause may be local. If a whole group behaves the same way, inspect shared configuration.
Trace where the header is set
The content type may be set by the application, web server, CDN, hosting layer or a plugin. Identify the layer responsible before changing values. Check recent deployments and configuration edits, but remember that timing is a clue rather than proof.
Inspect whether a redirect changes the requested resource or whether a proxy returns an error page with a misleading header. A successful status alone does not prove that the response contains the expected document. Examine the payload and final URL as well.
For assets such as PDFs, images or scripts, confirm that the response matches the file and that the browser should render or download it. Don’t force an HTML content type onto every route to make one page display. That may break files or API responses. I’d treat any “fix everything” header rule with suspicion.
Check caching and compression
A CDN or cache can preserve an old header after the origin has been corrected. Compare the origin and edge response if the platform allows it, and record cache indicators. Purge only through the approved process, then test again. Avoid repeatedly changing the application when the response is coming from an old cached copy. When something refuses to change after a fix, the cache is my first suspect.
Compression and encoding can complicate the inspection. Confirm that the body can be decoded and that a tool is not showing a compressed or partial response as if it were the page. If the content type is correct but the browser still fails, investigate encoding, CSP or the resource content separately.
Make a narrow correction
Change the setting at the layer that owns the response. Test the affected route and a sample of routes that share the configuration. Confirm that HTML pages render, files behave correctly and redirects still reach the intended destination.
Keep before-and-after headers and the reason for the change in the issue record. This makes it easier to diagnose a recurrence and helps prevent a later security or hosting change from undoing the fix.
Check impact on discovery and tools
An unexpected content type can affect more than how a browser displays a page. Crawlers, feeds, link preview tools or other integrations may interpret the response differently. Identify which consumers use the URL and test the behaviour that matters to them. Do not assume that a human browser view represents every client’s response.
If the URL should return HTML, confirm that its response body is a complete page and that the content type is set appropriately. If it should serve a file, verify the file can be opened or downloaded as intended. Check cache headers and redirects if a tool sees a different result from a browser.
For an API or machine-readable endpoint, preserve the format expected by its consumers. A broad rule that forces all responses to HTML may seem to fix one page while breaking an integration. Test representative endpoints after changing shared configuration and note any exclusions.
Check redirects, errors and file names
An unexpected content type can be caused by an error response, even when the URL looks like a page. Check the status and body before deciding the server has labelled a valid page incorrectly. A not-found or access-denied response may be returned as HTML or plain text depending on the platform.
For routes that serve files, inspect the extension, response header and actual file content together. A URL ending in .pdf that returns HTML may be a redirect or an error page; a route without an extension may still legitimately serve a document. Do not assume the filename alone determines the intended format.
If a CMS generates the route, compare the stored item with the published response. A stale mapping can return the wrong file or a fallback page. Correct the source and verify the final response from a clean session.
Keep evidence safe to share
When asking a hosting provider or developer to investigate, include a minimal reproduction and the response headers, but remove credentials, tokens or private query values. State whether the issue affects one route or a group and how you confirmed it. A concise report helps the right person act without circulating unnecessary site data.
After the correction, keep the working example and expected response in the release notes. This makes a regression easier to identify during a later deployment or CDN configuration change.
Related reading
- Finding unexpected pages generated by calendar navigation
- Technical SEO: HTTP response headers for site owners
- What to do with old event and campaign pages
Unexpected content types are much easier to solve when the response headers, not just a screenshot, are part of the evidence. Next time it happens, open developer tools, copy the headers and compare them with a working page of the same type. What’s the first difference you spot?