SVG doesn't work on subdomain - some browsers try to download rather than display
- by John Catterfeld
I have a site with a 'development' subdomain, which displays my SVG file exactly as intended.
However when I copy it across to www, or any other subdomain (e.g. 'test') some browsers try to open the file in an external editor, therefore asking me to download the file rather than displaying it.
For example:
http://development.mysite.com/test.svg - works
http://www.mysite.com/test.svg - doesn't work
The SVG file:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
</svg>
This happens in Firefox, Chrome and Safari, however IE9 and above display the file as intended.
It is a Windows hosting, and I have <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> in my web.config file
My hunch is that there must be some setting on the server which I need my hosting company to make. Can anyone suggest what might cause this issue?