Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IIS server blocking access to .webp files

So I'm trying to add .webp image support for a WordPress site, which is run on IIS.

Now the image exists on the server and the file name is correct but when I try to load the image via URL address in the browser I get the 404 error.

404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Anyone know how I might resolve this issue?

I tried added <add extension=".webp" policy="CacheUntilChange" kernelCachePolicy="DontCache" /> but this doesn't work as it's to do with caching.

Is there somewhere were I can allow access to certain file types?

Do I maybe need to allow the filetype through the firewall?

I'm still new to working with IIS so I'm a little lost.

Cheers

like image 691
Web Dev Guy Avatar asked Sep 04 '17 23:09

Web Dev Guy


1 Answers

You'll need to add this config to your webconfig file:

<configuration> 
    <system.webServer> 
        <staticContent> 
            <mimeMap fileExtension=".webp" mimeType="image/webp" /> 
        </staticContent> 
    </system.webServer> 
</configuration>
like image 118
Mahnian Avatar answered Oct 09 '22 18:10

Mahnian