IIS .webp file - add a MIME Type - HTTP error 404.3
In this post, I describe how to add support for a .webp file in IIS and ASP.NET to fix the error:
"HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."
Cause
This error occurs because I'm trying to access an image in WebP format on a site in IIS or ASP.NET which does not have the .webp MIME type added.
Resolution
ASP.NET
To resolve the error in ASP.NET, add the following to web.config:
<staticContent>
</staticContent>
</system.webServer>
IIS
To resolve the error in IIS Manager:
- Open IIS
- Go to your site then double click MIME Types:
- Press Add... under Actions in the top right:
- Enter .webp as the File name extension and image/webp as the MIME type:
The WebP image should now load successfully:
Comments
Post a Comment