How to get Apache to serve up .SVG and .SVGZ files

I ran into this today. This isn’t WP specific, but whatever. I’m sure I’ll have to do this again at some point.

Basically, .SVG files are Scalable Vector Graphics. A .SVGZ is a compressed version of it. It is a really good type of file format on the web for things like logos and icons.

I setup a development site for a client and the .SVGZ files weren’t showing up. To fix it I just had to drop in two lines in a .htaccess file.

AddType image/svg+xml svg svgz
AddEncoding gzip svgz

Boom!