Apache MultiViews serves a page at an unexpected URL
Diagnose extensionless URLs served by Apache MultiViews, distinguish negotiation from redirects, and repair duplicate routes without breaking language variants.
By Crawlito · 5 min read
In short
- MultiViews can select a file variant when an exact requested path does not exist.
- A successful extensionless response is not necessarily a redirect or application route.
- Test negotiation and intended URL mappings before disabling a directory option.
On this page
If Apache serves an article at an extensionless URL you never created, check whether MultiViews is selecting a matching file variant. A request for an absent path can be resolved through content negotiation rather than an explicit redirect. Identify that behavior, decide the intended public URL, and adjust the directory configuration or route mapping without breaking legitimate variants.
This can create confusing audit results: two URLs return the same article, yet no redirect rule or application route seems to explain the second one. The server may be resolving the file before the application gets involved.
Reproduce the unexpected route
Choose one known file and the extensionless URL that also works. Fetch both using GET and save their headers and bodies:
curl -sS -D full-headers.txt -o full.html \
'https://www.example.com/guides/setup.html'
curl -sS -D short-headers.txt -o short.html \
'https://www.example.com/guides/setup'Check whether either response is a redirect. If both return the same article directly, record that fact instead of describing the behavior as a redirect chain.
Compare the visible title, main text, canonical URL, and content type. Similar layouts alone do not prove the pages are identical.
Test a deliberately nonexistent name in the same directory. If every arbitrary route returns the homepage, a fallback rewrite may be involved instead. The soft 404 guide covers that separate behavior.
Keep the test on public routes you control. You only need a small representative sample to identify the mapping mechanism.
Understand the MultiViews selection
Apache's content negotiation documentation explains that MultiViews can search for matching filename variants when the exact requested file does not exist. It is a per-directory option and is not enabled merely by Options All.
For a directory containing setup.html, a request for setup may be resolved through that mechanism when MultiViews applies. The actual outcome depends on the directory contents and negotiation configuration.
Inspect the effective server configuration and relevant .htaccess files. Check parent directories as well as the directory containing the content. A hosting default can be easy to overlook when the application repository contains no matching rule.
Do not assume that every extensionless route is caused by MultiViews. Framework routing and rewrite rules can intentionally provide those URLs. Match the observed response with the effective configuration.
Write the cause as a testable statement: the absent extensionless path is resolved to a matching file under the directory's negotiation setting. This is more precise than “Apache creates duplicate pages.”
Decide which URLs should remain public
Choose the intended public address for each resource. A static site may prefer .html URLs, while another site may intentionally publish extensionless routes. Either decision needs consistent links and metadata.
Inventory the routes that already receive public links before removing a behavior. An old extensionless address may be a real entry point even if it was accidental originally.
If the site uses negotiated language or format variants, identify those explicitly. Disabling MultiViews broadly may change how those resources are selected. A fix for one guide directory should not silently break another section's language delivery.
The canonical URL guide helps align signals, but a canonical tag is not a replacement for deciding how the server should route requests.
Create a small mapping table with the old address, preferred address, content identity, and intended response. Include cases with no valid equivalent so they do not all get redirected to a generic page.
Make the smallest configuration change
If MultiViews is unintended in the affected directory, a scoped configuration may disable it:
Options -MultiViewsThis is a directive fragment, not a full server configuration. Its valid location and effect depend on your hosting setup and override permissions. Apply it through the supported configuration path and test syntax before a production reload.
Do not replace an existing Options line without understanding its other values. Preserve unrelated directory behavior.
If you need explicit redirects or extensionless application routes after disabling negotiation, define them deliberately. Test the final route rather than relying on a canonical tag to conceal an inaccessible preferred URL.
If MultiViews is intentional, keep it and repair the discovery signals or variant configuration instead. The goal is predictable resource selection, not removal of a feature solely because it exists.
Record the previous configuration and a rollback path. Server routing changes can affect more pages than the single URL that exposed the problem.
Verify normal, alternate, and missing paths
Repeat the original requests after the change. Confirm the chosen address serves the correct body and the alternate address follows the intended redirect or missing-resource behavior.
Check a legitimate language or format variant if the site uses them. Also test a nonexistent path and a path with a real file extension. These cases help distinguish the new routing contract from an overly broad rewrite.
A useful matrix is:
| Request | Intended behavior |
|---|---|
| Preferred article URL | Correct public article |
| Supported old alias | Explicit corresponding destination |
| Nonexistent name | Honest missing-resource response |
| Legitimate variant | Supported negotiated or explicit variant |
| Unrelated directory | Existing intended behavior |
Use the status and redirect guide to record response sequences accurately. Do not test only HEAD if the incident concerned the actual body returned to GET.
Inspect the final content, because a redirect that ends at an unrelated successful page is still a bad mapping.
Update discovery sources to the preferred address
Once the server behavior is correct, update internal links, canonical URLs, and sitemap entries to the intended destination. Avoid continuing to advertise an accidental alias everywhere.
Search templates and content files for the alternate shape. A link helper may generate extensionless paths while the sitemap generator adds .html, leaving the inconsistency in place after the server fix.
If a public route changed, verify links from relevant topic pages and the archive. Readers should reach the article without unnecessary detours.
Do not remove useful content or alter its publication date merely because its route handling changed. Keep the incident scoped to URL behavior unless the content itself needs a separate update.
For an agency report, list representative before and after requests and the configuration owner. This gives the client an actionable explanation of why two apparently unexplained URLs existed.
Test the next static publication
Generate a new page in a test environment using the normal publishing workflow. Confirm the intended URL is produced and that an unintended alias does not reappear through a parent configuration or hosting default.
Also test a file rename. The old address should follow the site's deliberate migration policy rather than being resolved to an unexpected similarly named file.
Keep a small regression sample of normal, alias, variant, and missing routes. The test should assert the resource and response behavior, not just the presence of a directive in a configuration file.
When changing hosts, include this routing contract in the migration handoff. A new provider can apply different defaults even when the static files are identical.
That makes the repair durable: the site knows which address represents each page and verifies what the public server actually returns.
Frequently asked questions
Does MultiViews always create a redirect?
No. It can select a representation to serve for the requested path. Inspect the actual status and body.
Should every Apache site disable MultiViews?
No. Some sites intentionally use content negotiation. Change the setting only after understanding the affected directory's requirements.
Can a canonical tag fix a broken route?
It cannot make an inaccessible destination work. Verify routing and canonical signals separately.
Use the free Crawlito check on the preferred article URL after the routing repair.
Filed under Access and robots.txt. Topics: http-status, canonical, troubleshooting