将网站上传到制作后不加载wordpress图像和字体

时间:2015-11-15 02:31:57

标签: php wordpress svg

在Web检查器中,图像的所有路径都是正确的(例如," src =" http://example.com/wp-content/themes/exampletheme/images/logo.svg&# 34;)但没有出现任何SVG文件。

其他所有内容都在网站上运行,除了字体文件给我404错误,但这可能是由于其他原因。

Weirder,图像甚至没有出现在媒体选择工具中,例如:

broken images

编辑:网站的位置为:privacyhorizon.com

更新: 我尝试过添加

AddType image/svg+xml svg svgz
AddEncoding gzip svgz

到我的.htaccess,没有看到任何变化:(

1 个答案:

答案 0 :(得分:2)

您的生产计算机正在运行Microsoft IIS 7.0 http服务器。除非您安装某些扩展名,否则Htaccess将无法在该环境下运行。

在审核了您的网站链接后,很明显svg文件不是唯一的问题。永久链接也不起作用。

要解决永久链接问题,请将其粘贴到system.webServer xml元素下的Web.config文件中:

<rewrite> <rules> <rule name="Main Rule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> </conditions> <action type="Rewrite" url="index.php" /> </rule> </rules> </rewrite>

要解决 svg mime类型问题,请在system.webServer xml元素中添加: <staticContent> <mimeMap fileExtension=".svg" mimeType="image/svg+xml" /> </staticContent>