Help Docs Control Panel Guides Cloud Sites Guide Website Management in Cloud Sites PHP for Cloud Sites Display SVG Images via PHP in Cloud Sites

Display SVG Images via PHP in Cloud Sites

In order to properly display SVG image types within the PHP environment, a specific line must be added to your .htaccess file. This line will tell the Apache instance the proper MIME type to use when serving request for SVG style image files.

In order to properly display SVG image types within the PHP environment, a specific line must be added to your .htaccess file.

AddType image/svg.xml svg

This line will tell the Apache instance the proper MIME type to use when serving request for SVG style image files. MIME is a standard for formatting files of different types like text, graphics or audio so they can be sent over the Internet or seen and played by a web browser or email application. You can find an extensive list of the MIME types Apache supports in the Apache documentation: http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types

You can use the AddType command in your .htaccess file for any MIME type, just insert the type in the line of code in the .htaccess file and save (for more information about .htaccess files see our article What Is an .htaccess File?.

Was this article helpful?