I currently use the following Apache httpd conf:
<FilesMatch "\.svg$">
SetHandler application/x-httpd-php
</FilesMatch>
AddType image/svg+xml .svg
What I'm trying to achieve:
- Parsing the PHP scripts in my SVG files
- Serving my SVG files with the
image/svg+xml
MIME type
However, the AddType
seems to be ignored now that I've set it to use the alternative handler for my SVG files. They're now served as text/html
.
How can I make the httpd parse the PHP in my SVG files while preserving its image/svg+xml
type?
I currently include a header("Content-type: image/svg+xml");
call in my SVG file to solve this, although I'd rather have a global way of doing this instead of having to insert this into all of my SVG files.
- CentOS 6.5
- Apache 2.2.15
- PHP 5.3.3