mimeMap still does not display my svg

2019-08-30 20:50发布

I am sorry if it is something novice or silly but this is my first time using a web.config file.

I have been dealing with the pleasure of godaddy not provide svg support by default. So I found some info on using a web.config file to inform the browser what to do with this file type.

Sources

  1. Link 1

  2. Link 2

  3. Link 3


I am able to get the file in the server without crashing everything. The website will still display instead of displaying a 500 (internal) error but the svg still does nothing.

Here is my web.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.webServer>
    <staticContent>
        <remove fileExtension=".svg" />
        <mimeMap fileExtension=".svg" mimeType="images/svg+xml" />
        <remove fileExtension=".svgz" />
        <mimeMap fileExtension=".svgz" mimeType="images/svg+xml" />
    </staticContent>
  </system.webServer>
</configuration>

Does anyone know what I am doing wrong? I also put the file into the main root file on the server but no luck.

Live site if it helps: Mobile app design

1条回答
看我几分像从前
2楼-- · 2019-08-30 21:23

It appears your mimeType is incorrect. Remove the "s" from the images:

<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />

reference, if you like documentation

查看更多
登录 后发表回答