Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why the error 404 happens when I access *.mp4 file by HTTP?

I have some shared folder over HTTP. Lets say: http://myserver/files

And there are some filed like png, avi, jpg, mp4 and etc.

I can easily access *.png or *.avi via browser (http://myserver/files/555.avi) but cannot access to *.mp4.

So IIS gives the 404 error.

What's up?

Thank you!

UPDATES:

May be it is important: I have to access by this URL format

http://112.333.44.33/files/555.mp4

like image 580
Friend Avatar asked Jan 13 '12 15:01

Friend


People also ask

How do I fix HTTP error 404?

The simplest and easiest way to fix your 404 error code is to redirect the page to another one. You can perform this task using a 301 redirect. What's 301, you may ask? It's a redirect response code that signals a browser that the content has been transferred to another URL.

What does Error 404 Mean while accessing a URL?

404 error codes are generated when a user attempts to access a webpage that does not exist, has been moved, or has a dead or broken link. The 404 error code is one of the most frequent errors a web user encounters. Servers are required to respond to client requests, such as when a user attempts to visit a webpage.


4 Answers

So I found the solution.

I just added correct MIME type to my website.

Extension: mp4

MIME type: video/mpeg

And now it works fine.

like image 150
Friend Avatar answered Oct 23 '22 09:10

Friend


Add a MIME type with extension mp4 in IIS

But please note that you should set the MIME type video/mp4 instead of video/mpeg orelse in IE "Save Target As.." shows different format, and it also affects the default video player open by browser.

video/mpeg

File name: test.mpeg

Save as type: Movie Clip

video/mp4

File name: test.mp4

Save as type: MP4 Video

like image 44
Eric Avatar answered Oct 23 '22 10:10

Eric


I just had that issue, and I compared my IIS10 (win10) and IIS 7.5 (win2008 R2) applicationhost.config files, and these are the changes I sent from iis10 to iis75.

29 new types, and 5 modified.

Watch out for .ts if you use typescript... ts was a video file before being a programming language file

<!-- new types -->
<mimeMap fileExtension=".3g2" mimeType="video/3gpp2" />
<mimeMap fileExtension=".3gp2" mimeType="video/3gpp2" />
<mimeMap fileExtension=".3gp" mimeType="video/3gpp" />
<mimeMap fileExtension=".3gpp" mimeType="video/3gpp" />
<mimeMap fileExtension=".aac" mimeType="audio/aac" />
<mimeMap fileExtension=".adt" mimeType="audio/vnd.dlna.adts" />
<mimeMap fileExtension=".adts" mimeType="audio/vnd.dlna.adts" />
<mimeMap fileExtension=".appcache" mimeType="text/cache-manifest" />
<mimeMap fileExtension=".dvr-ms" mimeType="video/x-ms-dvr" />
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".jsonld" mimeType="application/ld+json" />
<mimeMap fileExtension=".less" mimeType="text/css" />
<mimeMap fileExtension=".m2ts" mimeType="video/vnd.dlna.mpeg-tts" />
<mimeMap fileExtension=".m4a" mimeType="audio/mp4" />
<mimeMap fileExtension=".m4v" mimeType="video/mp4" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".mp4v" mimeType="video/mp4" />
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
<mimeMap fileExtension=".ts" mimeType="video/vnd.dlna.mpeg-tts" />
<mimeMap fileExtension=".tts" mimeType="video/vnd.dlna.mpeg-tts" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
<mimeMap fileExtension=".wtv" mimeType="video/x-ms-wtv" />

<!-- modified types -->
<mimeMap fileExtension=".avi" mimeType="video/avi" />
<mimeMap fileExtension=".cab" mimeType="application/vnd.ms-cab-compressed" />
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension=".ics" mimeType="text/calendar" />
<mimeMap fileExtension=".js" mimeType="application/javascript" />
like image 41
foxontherock Avatar answered Oct 23 '22 10:10

foxontherock


I just found the cause of the issue in my cpanel who give me this 404 on mp4 problem maybe is useful for someone, the file manager v3 happen to change the first character of the name of ".mp4" to a capital letter, so i get back and change my html and it works.

like image 30
Alfangel Avatar answered Oct 23 '22 10:10

Alfangel