- 编辑httpd.conf文件,找到"DefaultType"指令并将其值设置为"none"。
DefaultType: the default MIME type the server will use for a document
that doesn't otherwise have a MIME type set.
DefaultType none
- 修改.htaccess文件,添加以下指令:
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s
RewriteRule ^wp-content/uploads/(.):(.)$ wp-content/uploads/$1%3A$2 [NE,T=image/svg+xml]
- 重新启动Apache服务器。