How do I diagnose a 404 response when a file or application route should exist?
A 404 can originate from the web server, application router or an upstream proxy. The file’s existence somewhere on the server is not sufficient: the requested hostname must map to the correct site, and the URL must match that site’s routing rules. Start by reproducing the exact failing request.
Before you start
- The exact URL, expected route and active site configuration.
Instructions
1. Check the request and hostname
Use the public URL, including any required trailing slash and case. A bare-IP request can select a different default site and produce a misleading result.
curl --silent --show-error --output /dev/null --write-out '%{http_code}
' --max-time 15 https://app.example.com/help/Displays the response status for the selected route.
2. Confirm the configured path
For a static route, inspect the file under the actual document root. For an application route, check whether the request is forwarded to the intended front controller or upstream instead.
ls -ld /var/www/app/public/help
ls -l /var/www/app/public/help/index.htmlChecks this example static directory and index. It is not a universal mapping for framework routes.
3. Correlate logs and route rules
Read the site access/error log for that request and review only the matching location, alias, rewrite or application route. Compare filename case carefully on Linux. Avoid replacing the global rewrite configuration just to make one path resolve.
Check the result
- The intended URL reaches the correct file or application handler.
- Unknown URLs still return a genuine 404 rather than all being rewritten to a successful home page.
Troubleshooting
- The route works with one letter case only
- Use the site’s canonical URL and correct the specific link or filename mapping. Linux paths are commonly case-sensitive.
- Every framework subpage returns 404
- Inspect the front-controller or reverse-proxy route for that site and follow the framework’s supported deployment configuration.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
