The HTTP status code 404 indicates the server could not find the requested file.

learn more… | top users | synonyms (1)

245
votes
10answers
49k views

How can I properly handle 404 in ASP.NET MVC?

I am just getting started on ASP.NET MVC so bear with me. I've searched around this site and various others and have seen a few implementations of this. EDIT: I forgot to mention I am using RC2 ...
154
votes
3answers
59k views

How to redirect to a 404 in Rails?

I'd like to 'fake' a 404 page in Rails. In PHP, I would just send a header with the error code as such: header("HTTP/1.0 404 Not Found"); How is that done with Rails?
80
votes
5answers
25k views

Why is @font-face throwing a 404 error on woff files?

I'm using @font-face on my company's site and it works/looks great. Except Firefox and Chrome will throw a 404 error on the .woff file. IE does not throw the error. I have the fonts located at the ...
68
votes
13answers
75k views

Sending a 404 error in PHP

if (strstr($_SERVER['REQUEST_URI'],'index.php')) { header('HTTP/1.0 404 Not Found'); } Why wont this work? I get a blank page.
62
votes
10answers
55k views

Easy way to test a URL for 404 in PHP?

I'm teaching myself some basic scraping and I've found that sometimes the URL's that I feed into my code return 404, which gums up all the rest of my code. So I need a test at the top of the code to ...
58
votes
6answers
15k views

What is the proper way to send an HTTP 404 response from an ASP.NET MVC action?

If given the route: {FeedName}/{ItemPermalink} ex: /Blog/Hello-World If the item doesn't exist, I want to return a 404. What is the right way to do this in ASP.NET MVC?
45
votes
7answers
12k views

How to get MVC action to return 404

I have an action that takes in a string that is used to retrieve some data. If this string results in no data being returned (maybe because it has been deleted), I want to return a 404 and display an ...
43
votes
9answers
43k views

Custom ASP.NET MVC 404 Error Page

I am trying to make a custom HTTP 404 error page when someone types in a URL that doesn't invoke a valid action or controller in ASP.NET MVC. Instead of it displaying the generic Resource Not Found ...
40
votes
6answers
28k views

ASP.NET Custom 404 Returning 200 OK Instead of 404 Not Found

After trying to setup my site for Google Webmaster Tools I found that my Custom ASP.NET 404 page was not returning the 404 status code. It displayed the correct custom page and told the browser that ...
32
votes
3answers
8k views

Google Analytics - Failed to load resource: http://www.google-analytics.com/ga.js

I've been noticing this error on Chrome's console for a while now: I modified Google's script so that it logs the error, because it uses try{} catch{}, and this is what I got: I haven't noticed ...
31
votes
7answers
16k views

Google App Engine and 404 error

I've setup a static website on GAE using hints found elsewhere, but can't figure out how to return a 404 error. My app.yaml file looks like - url: (.*)/ static_files: static\1/index.html upload: ...
29
votes
5answers
18k views

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 = ...
25
votes
6answers
611 views

redirect 404 to similar urls

I have a website with stories in it. I can have multiple types of stories within multiple categories like: children romance scifi action thriler quests The stories are accessible using urls like: ...
25
votes
1answer
4k views

Image Get Requests with AngularJS

I am storing the the source string of an image to be rendered in HTML in the AngularJS controller, however it yields a 404 before the Angular controller is initialized. Here is the HTML: <div ...
23
votes
4answers
9k views

How can I return a 404/50x status code from a Grails Controller?

I have a controller that needs to return a 404 page and status code on certain conditions. I can't seem to find out how to do this in Grails. A coworker recommended this method: ...

15 30 50 per page