What does "File not found" mean on a web page?

13,144

Solution 1

I think I've found the reason for this.

When a web server encounters an error, it normally serves a document (usually an HTML document describing the error) to the browser, indicating the error condition using the HTTP status code.

According to this bug report, Firefox originally always displayed the returned document; normally this is what you want. However, a user found an issue with a misconfigured AOL server: when requesting a nonexistent EXE file, the server would serve the 404 page, but with an incorrect Content-Type. That caused Firefox to offer to download the HTML document with a .exe extension, which was confusing since there was no indication that any error occurred. They changed the behavior with a simple hack (not warranting the effort of writing a new error message page, since it's an uncommon case, instead reusing the "not found" page, which makes sense in the specific example given by the bug's reporter).

From the bug report that @m4573r found, it sounds like the current behavior when Firefox receives a response with an HTTP code signaling an error, and the response's Content-Type is something other than HTML, then Firefox displays a "File not found" error page.

The vast majority of web servers are configured to serve an HTML document on error, which is why you don't normally see this. But in this corner case, the error message doesn't make sense.

wget -d http://www.ssa.gov/framework/images/icons/png/ confirms what's going on here:

---response begin---
HTTP/1.1 500 Server Error
Server: Generic Web Server 1.0
Date: Thu, 20 Feb 2014 23:29:57 GMT
Cache-control: public
Content-type: magnus-internal/directory
Transfer-encoding: chunked

---response end---

It's serving the error page with the bogus Content-type of magnus-internal/directory, triggering the behavior in Firefox.

Evidently Google thought that this behavior made sense and implemented it similarly in Chromium.

Solution 2

It's been reported as a bug in... 2008 :/ Seems that it's on a low priority list.

Solution 3

Since you said in ur question that there is no file involved so I think that telling you a little about how web works may clear your doubt.

When you send a request to a server, you are indeed requesting a file stored on the server or a file generated by the server if the request is asking for dynamic content.

Url is divided into 3 parts:

1) Http:// << the protocol used

2) www.whatever.com << the dns used to identify the server(comp from where u are asking for content)

3) /music/song.mp3 << the location of file on the server

So this error message just states that the file that you have requested is not found. I have taken example of a music file but even a webpage with .html extension can be requested and same error might be generated.

This error just says that the resource ie webpage, music file, video or whichever type of file you have requested could not be found on the server.

Share:
13,144

Related videos on Youtube

Mechanical snail
Author by

Mechanical snail

🐌. Native speaker of American English. Linux user. Familiar with several programming languages in the procedural, OO, and functional paradigms. Worst Code Golf ever New badge proposals! Shakespeare bug in Ubuntu The Great Question Deletion Audit of 2012 Chat Horrible spiders Adorable fluffy things LASERS! Link rot is evil. Archive everything. The keyboard is king. Correctness over performance. Canonicalize, normalize, deduplicate. Don't repeat yourself. UTF-8 &gt; UTF-16. Use static typing: good for tooling. Re-use; don't re-invent. Correctness, then clarity, then concision and elegance. Play devil's advocate. First understand opponents' positions.

Updated on September 18, 2022

Comments

  • Mechanical snail
    Mechanical snail over 1 year

    When I access certain HTTP URLs, such as http://www.ssa.gov/framework/images/icons/png/ in Firefox (running on Linux), I surprisingly get a "Problem loading page" browser error, containing the "File not found" message that is used for local files:

    Firefox

    The text doesn't seem to make sense, since there is no file involved.

    At first I thought it might just be a Firefox bug, but the same thing happens in Chromium:

    Chromium

    When I tell Wget to download it, it reports 500 Server Error. But it can't be that browsers display "File not found" on receiving a 500 error, because it doesn't happen when I access https://httpbin.org/status/500.

    What causes this error message, and what does it mean?

    • Michael Frank
      Michael Frank about 10 years
      Computer says 'No'. Basically it looks like you're trying to access a folder you don't have access to, but it's having trouble displaying the appropriate error page.
    • quadruplebucky
      quadruplebucky about 10 years
      That's actually an odd case, a wget -d returns a 500 error code followed by what looks like a well-formatted custom 404 page.
  • Mechanical snail
    Mechanical snail about 10 years
    From the description though, it seems to result from how Firefox's error-handling code was implemented. Interesting that Chromium would have the same bug.
  • m4573r
    m4573r about 10 years
    Indeed. Your answer is better :)
  • Thomas
    Thomas about 10 years
    You may or may not be right in this particular case, but in general that is patently untrue. The web server gets the URL you sent (here /framework/images/icons/png/) and is then free to serve whatever content it wants. There doesn't have to be a file name and extension at the end of the URL, it just often is the case as it reflects the file hierarchy of the website. Similarly, you can be served a .png from an URL that ends in .gif and so on.
  • saywha
    saywha about 10 years
    There was a period at the end, telling the browser that the file name and type were left blank. Had the period NOT been there it would have shown what was in the folder.
  • Thomas
    Thomas about 10 years
    I'm talking about your general statement and analogy to the stranger's house. It's completely wrong. How and where content is served is up to the configuration of the web server and the website, there is no fundamental rule that URL's need to look like a file path when serving a file. The analogy fails in that you're asking stranger for /framework/images/icons/png/, whatever that may be, and it knows - or is supposed to know - what to do.
  • rishimaharaj
    rishimaharaj about 10 years
    I think the period was the end of the error message's sentence: Firefox can't find the file at [URL].
  • saywha
    saywha about 10 years
    If you look at the original post, the period was at the end of the partial URL that was being looked for AND in the error text, both. And, Thomas, you are still ignoring the period. Having that period there is what caused the file to not be found. ../png/ is not the same as ../png/. at all.
  • Dracs
    Dracs about 10 years
    That period is indicating the end of the sentence in the error message. It is not part of the URL.
  • esqew
    esqew about 10 years
    Why am I not surprised it was a misconfigured AOL server...
  • Mechanical snail
    Mechanical snail about 10 years
    @esqew: And now, a misconfigured government agency's server!