
September 4, 2025 10:00 by
Peter
These days, the majority of websites are created with HTML5 and backdrop videos. Using the video tag is a simple task. Although using a CDN is recommended for serving video files, you must set up IIS to serve.mp4 files if you wish to host videos from your own server. A 404 error or an error stating that "The page you are requesting cannot be served because of the extension configuration" may appear if you don't configure it.

If the page is a script, add a handler. If the file should be downloaded, add a MIME map.” Again, if you have got access to IIS , it’s a great thing but what if you’re hosting the website on a shared server where you don’t have access to IIS Server? In this post, we will see how can we enable IIS Server to serve .mp4 files through web.config file.
To allow IIS to server files, we need to configure proper mimeType for the required files. The mimeType for a .mp4 is video/mp4. Just add the following line in your web.config file under system.webServer tag and you should be good to go.
<configuration>
<system .webServer>
<staticcontent>
<mimemap fileExtension=".mp4" mimeType="video/mp4"></mimemap>
</staticcontent>
</system>
</configuration>
Once you do the above changes, your web server should start serving .mp4 files without issues. Hope this blog post helps you! In case you know other ways of doing the same, do let me know via comments.