Browser Won’t Display SVG Locally?

Ok here’s the sitch.

You can pull in svg from a cdn and everything work. But when you try and use your local svg graphics, everything goes to shit.

It’s probably that you’re not serving svg in with the right headers, especially if you’ve saved your svg graphic from illustrator. There’s a great explanation here:

If you’re running XAMPP do the following:

pico /Applications/XAMPP/etc/httpd.conf

And add the following to: ”

<IfModule mime_module>

# add support for svg
    AddType image/svg+xml svg svgz
    AddEncoding gzip svgz

Restart XAMPP and you should be serving svg!



Leave a Reply

Your email address will not be published. Required fields are marked *