Had a really weird bug the other day where an .svg image was not displaying as a background image.

Locally, everything was fine (running a local server, using MAMP) but when I pushed to the server, the .svg would not show.

The file was on the server, not corrupted, with the correct SVG URL in the CSS – I couldn’t for the life of me see what the issue was.

I then noticed in developer tools that the content type for the SVG was coming up as text/XML.

Adding the following line to the .htaccess fixed the issue for me:

AddType image/svg+xml .svg .svgz