Questions tagged [http-status-code-404]

The HTTP status code 404 or "Not Found" indicates the server could not find the requested file or resource.

A 404 often means that the URL requested is invalid or points to a file that no longer exists (e.g. has been moved or deleted). It can also mean that web service method or other similar resource does not exist.

Many web servers can be configured to display a specific error page when this occurs which allows users to continue navigating in a manner consistent with the design of the website.

See RFC2616 for reference.

Microsoft's Internet Information Services (IIS) versions 7, 7.5, and 8.0 provide additional sub-status values for various types of 404 response statuses. These are not recognized as standard status codes, but may be relevant for IIS-hosted applications.

Microsoft Sub-Status Codes:

404.0 – Not found.
404.1 – Site Not Found.
404.2 – ISAPI or CGI restriction.
404.3 – MIME type restriction.
404.4 – No handler configured.
404.5 – Denied by request filtering configuration.
404.6 – Verb denied.
404.7 – File extension denied.
404.8 – Hidden namespace.
404.9 – File attribute hidden.
404.10 – Request header too long.
404.11 – Request contains double escape sequence.
404.12 – Request contains high-bit characters.
404.13 – Content length too large.
404.14 – Request URL too long.
404.15 – Query string too long.
404.16 – DAV request sent to the static file handler.
404.17 – Dynamic content mapped to the static file handler via a wildcard MIME mapping.
404.18 – Query string sequence denied.
404.19 – Denied by filtering rule.
404.20 – Too Many URL Segments.

6856 questions
51
votes
4 answers

How to let react router respond with 404 status code?

I'm using react router as root and all requests under "/" are directed to react router. And when react router found that the url is not matched with any of the defined components, it renders with NoMatch component. And here goes the problem, NoMatch…
Liang
  • 1,127
  • 2
  • 11
  • 22
48
votes
5 answers

LESS file does not load (404)

I'm using IIS 7.5 and I'm unable to load the less file because it gives a 404 error. HTML: Less Tutorial
Diogo Cardoso
  • 21,637
  • 26
  • 100
  • 138
47
votes
5 answers

How to create a 404 component in vuejs using vue-router

I'm new to vuejs and I'm working on my first project with vue. I'm just wondering how I will route to my 404.vue component when the requested url is not found. Any Idea?
Kamga Simo Junior
  • 1,679
  • 2
  • 16
  • 30
45
votes
9 answers

ASP.net HTTP 404 - File not found instead of MaxRequestLength exception

I have a file upload control on my webpage. The maximum request length is set to 8 MB (maxRequestLength = 8192). I also have server validation that throws an error if the file is more than 4MB. The reason that its 8MB in the config is the leverage…
Divi
  • 7,621
  • 13
  • 47
  • 63
45
votes
4 answers

Flask Application - How to link a javascript file to website

I am having some trouble getting started with using javascript files on my website (A Flask application). I start the website by running run.py which looks like this: #!flask/bin/python from app import app app.run(debug=True) In my html page I have…
user2260199
  • 877
  • 4
  • 13
  • 20
45
votes
5 answers

AngularJS and Handling 404 Errors

What is the best way to serve up proper 404's with an AngularJS app? A little background: I'm building an Angular app and have opted to use $locationProvider.html5Mode(true); because I want the URLs to appear natural (and indistinguishable from a…
44
votes
7 answers

flask: error_handler for blueprints

Can error_handler be set for a blueprint? @blueprint.errorhandler(404) def page_not_found(error): return 'This page does not exist', 404 edit: https://github.com/mitsuhiko/flask/blob/18413ed1bf08261acf6d40f8ba65a98ae586bb29/flask/blueprints.py…
blueblank
  • 4,724
  • 9
  • 48
  • 73
43
votes
9 answers

How do I force redirect all 404's (or every page, whether invalid or not) to the homepage?

Currently every invalid page is 500 (Internal Server Error) because I probably messed up with my server block configuration. I decided to shut down my website a while ago and created a simple one-page, thank-you homepage. However old links and…
hobbes3
  • 28,078
  • 24
  • 87
  • 116
42
votes
4 answers

IIS7 custom 404 not showing

created a new IIS7 web site with Intergrated .net 4.0 app pool. URLs ending with .aspx do show custom 404 anything else gives the blue server error page "HTTP Error 404.0 - Not Found The resource you are looking for has been removed, had its name…
rob
  • 8,134
  • 8
  • 58
  • 68
42
votes
2 answers

How to detect an error 404 in an iframe?

My Web page uses iframes to collect content from other pages. All pages are in the same domain. From the main page, is there a way to confirm that all iframes have loaded, and that there is no 404 error?
Christophe
  • 27,383
  • 28
  • 97
  • 140
41
votes
5 answers

Django staticfiles app help

I've having a little issue with Django's staticfiles app. I have added 'django.contrib.staticfiles', to my INSTALLED_APPS and have added STATIC_URL = '/static/' STATIC_ROOT = '/Users/kevdotbadger/django/mylook/static/' to my settings.py file. All…
dotty
  • 40,405
  • 66
  • 150
  • 195
41
votes
4 answers

How do you return 404 when resource is not found in Django REST Framework

When a user inputs a url that is wrong, my Django app returns an HTML error. How can I get DRF to return a json formatted error? Currently my urls is from django.conf.urls import url from snippets import views urlpatterns = [ …
Reimus Klinsman
  • 898
  • 2
  • 12
  • 23
40
votes
4 answers

Access denied: 403 or 404?

What status code should be returned if somebody request access to the entity that he is not permitted to see? You'll probably say it's 403: Forbidden. But is it common practice to return 404 instead? I don't want somebody know that this entity even…
Robo Robok
  • 21,132
  • 17
  • 68
  • 126
40
votes
2 answers

One location block for all Nginx error codes

Is it possible to have the 40x and 50x errors served by a single location rule? Something like: error_page 403 /403.html; error_page 404 /404.html; error_page 405 /405.html; error_page 500 501 502 503 504 /5xx.html; location ~…
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
40
votes
3 answers

Why does HttpWebRequest throw an exception instead returning HttpStatusCode.NotFound?

I'm trying to verify the existence of a Url using HttpWebRequest. I found a few examples that do basically this: HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(Url); request.Method = "HEAD"; using (HttpWebResponse response =…
SelAromDotNet
  • 4,715
  • 5
  • 37
  • 59