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
31
votes
6 answers

Angular 2 Hosted on IIS: HTTP Error 404

I have simple app with one component that expects certain parameters from url. there is only one route in the application: const appRoutes: Routes = path: 'hero/:userId/:languageId',component: HeroWidgetComponent }]; In the…
Hussein Salman
  • 7,806
  • 15
  • 60
  • 98
31
votes
2 answers

sourceMappingURL from jquery generates 404 error in apache

Was browsing through apache logs and found interesting thing: When a users access any page where I have included jquery, apache tries to get jquery-xxx.min.map file and failed with 404 error. Here is an example: xxx.xxx.xxx - - [Date:TIME +0000]…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
30
votes
4 answers

How do I select only the root domain from $_SERVER['HTTP_REFERER'];?

I want to have a 404 page that can detect if a user has come to that page either via my site, via my shortened URL or via another site, and I am making it using PHP. I am slowly getting to grips with PHP and this may well be a simple question, but…
Nathan Bunn
  • 597
  • 1
  • 7
  • 14
30
votes
5 answers

Returning 404 Error ASP.NET MVC 3

I have tried the following 2 things to have a page return a 404 error: public ActionResult Index() { return new HttpStatusCodeResult(404); } public ActionResult NotFound() { return HttpNotFound(); } but both of them just render a blank…
ryanzec
  • 27,284
  • 38
  • 112
  • 169
30
votes
4 answers

Is there a way to force apache to return 404 instead of 403?

Is there a way how I can configure the Apache web server to return a 404 (not found) error code instead of 403 (forbidden) for some specific directories which I want to disallow to be accessed? I found some solutions suggesting the use of…
29
votes
7 answers

Error 404: The requested resource is not available using HelloWorld servlet

I am writing a Java Servlet, and I am struggling to get a simple HelloWorld example to work properly. The HelloWorld.java class is: package crunch; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld…
Tom Haddad
  • 377
  • 2
  • 5
  • 12
28
votes
4 answers

How to properly setup custom handler404 in django?

According to the documentation this should be fairly simple: I just need to define handler404. Currently I am doing, in my top urls.py: urlpatterns = [ ... ] handler404 = 'myapp.views.handle_page_not_found' The application is installed. The…
blueFast
  • 41,341
  • 63
  • 198
  • 344
28
votes
5 answers

Ionic + Angular - How to avoid the "404 Not Found (from cache)" after POST request?

this question is partly pointing to my previous question : Ionic + Angular POST request return state 404 But i wasn't able to find working solution. Problem is following: if I do request from the mobile app running on the device i always get…
redrom
  • 11,502
  • 31
  • 157
  • 264
28
votes
2 answers

Getting 404 Not Found error while trying to use ErrorDocument

I know this thread has been talked a lot on the web and here, and I tried almost all the methods, but still I'm having the same problem. This is my url on my local server ( MAMP ) http://localhost:8888/hellothere/index.php And I've tried to insert…
user1725155
  • 345
  • 1
  • 4
  • 11
27
votes
2 answers

Zend Framework: How to intentionally throw a 404 error?

I would like to intentionally cause a 404 error within one of the controllers in my Zend Framework application. How can I do this?
Andrew
  • 227,796
  • 193
  • 515
  • 708
27
votes
5 answers

Replace invalid image url with 404 image

I don't know if this is possible or not, I have an image host that I've made myself. I need some last tweaks with it. Whenever an image has been deleted or is an invalid image url, it should replace with an 404 image, so for example if someone adds…
MacMac
  • 34,294
  • 55
  • 151
  • 222
27
votes
4 answers

Simplest way to define a route that returns a 404

I've got a requirement to specify a named route in a Ruby on Rails project that returns the public/404.html page along with the 404 server response code. Leaving it blank is not an option, please don't question why, it just is :) It absolutely…
Eliot Sykes
  • 9,616
  • 6
  • 50
  • 64
26
votes
6 answers

nginx location 404 not found

Here are my nginx configure files. On the default.conf, the first location is used to access /usr/share/nginx/html directory, it is ok while I access http://47.91.152.99. But when I add up a new location for directory /usr/share/nginx/public…
26
votes
1 answer

Font files 404 on Azure Websites, seemingly correct MIME

I get WOFF and WOFF2 fonts to work on my IIS Manager 6 localhost, but they give a 404 when I host the site on Azure Websites. I think I have the correct MIME type in Web.config (tried with and without dots). I see the files when I connect by FTP. I…
camelBase
  • 917
  • 1
  • 8
  • 16
26
votes
6 answers

Basic Rails 404 Error Page

I have been looking for a simple answer to this for a ridiculously long time and it seems like this has to be so plainly obvious and simple because no one has an easy, idiot proof tutorial. Anyway, all I want to do is to have a single 404.html…
chrishomer
  • 4,900
  • 5
  • 38
  • 52