Apache上的svg + xml仍然作为text / plain提供

时间:2016-02-19 17:26:30

标签: apache .htaccess svg

认为我已经涵盖了所有基础,但我的SVG仍然以文本形式出现。

这是SVG代码:

<svg xmlns="http://www.w3.org/2000/svg" style="background-color: rgb(255, 255, 255);" xmlns:xlink="http://www.w3.org/1999/xlink" width="285px" height="382px" version="1.1"><defs/><g transform="translate(0.5,0.5)"><ellipse cx="142" cy="135" rx="110" ry="95" fill="#ffffff" stroke="#000000" transform="rotate(26,142,135)" pointer-events="none"/><ellipse cx="142" cy="135" rx="106" ry="91" fill="transparent" stroke="#000000" transform="rotate(26,142,135)" pointer-events="none"/><path d="M 12 270 L 142 270 L 162 290 L 162 380 L 32 380 L 12 360 L 12 270 Z" fill="#ffffff" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/><path d="M 32 380 L 32 290 L 12 270 M 32 290 L 162 290" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="none"/></g></svg>

我的.htaccess文件包含:

# SVG
AddType image/svg+xml .svg
AddType image/svg+xml .svgz
AddEncoding gzip .svg

我的httpd.conf文件包含:

AddType image/svg+xml .svg
AddType image/svg+xml .svgz

mime.types有:

image/svg+xml           svg svgz

它可以作为嵌入工作,但不能用作图像标记src,也不能用作独立的网址:

http://blogs.shu.edu/tomstest/files/2015/09/drawit-diagram.svg

是否存在其他可能潜伏配置的地方?

响应标题如下:

Connection  Keep-Alive
Content-Encoding    gzip
Content-Length  348
Content-Type    text/plain; charset=UTF-8
Date    Fri, 19 Feb 2016 18:58:31 GMT
Etag    "2533d2400403b62e41cfb5e995d19478"
Expires Mon, 22 Apr 2019 04:45:11 GMT
Keep-Alive  timeout=5, max=75
Last-Modified   Fri, 19 Feb 2016 16:41:59 GMT
Server  Apache
Vary    Accept-Encoding

0 个答案:

没有答案
相关问题