Resource interpreted as Font but transferred with MIME type text/html in Opencart

▼魔方 西西 提交于 2019-12-10 10:09:10

问题


I have seen a lot of answers in stackoverflow about this issue but none of them solve my issue.

I am using Opencart Store with custom typography and I see this error:

Resource interpreted as Font but transferred with MIME type text/html: "[http://www.11maguen11.com/catalog/view/theme/default/stylesheet/miller-textroman-webfont.woff]".

Resource interpreted as Font but transferred with MIME type text/html: "[http://www.11maguen11.com/catalog/view/theme/default/stylesheet/miller-textroman-webfont.ttf]".

Resource interpreted as Font but transferred with MIME type text/html: "[http://www.11maguen11.com/catalog/view/theme/default/stylesheet/miller-textroman-webfont.svg]".

I have tried to add in the .htaccess

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff  
AddType application/x-font-woff .woff

and other different possibilities I see in stackoverflow but I can't solve my problem without any of them.

Also in the index of my homepage the slideshow is loading like a very slow loading (as internet in the past) as you can see here:

http://www.11maguen11.com/slidemal.jpg

http://www.11maguen11.com/slidemal2.jpg

And I don't know if is related with this issue.

The website is: http://11maguen11.com


回答1:


I have had this problem myself and the solution is quite simple but hard to find :)

in catalog folder there is another .htaccess ( i presume you call the custom font from the theme ) you need to add the exceptions in that .htaccess file:

It should be like this after you edit it

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !^(.+)\.jpg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.jpeg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.png$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.gif$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.css$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.js$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.woff$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.ttf$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.otf$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.svg$
RewriteCond %{REQUEST_FILENAME} !^(.+)\.eot$
RewriteRule ^(.+)$ /404.html [NC]

AddDefaultCharset UTF-8

And lastly there seems to be an encoding issue with your images, i do not know exactly where the problem might be, but it is certainly similar, maybe .jp is not in the rules above as it should be.

Hope i answered your questions :)



来源:https://stackoverflow.com/questions/22692674/resource-interpreted-as-font-but-transferred-with-mime-type-text-html-in-opencar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!