@fontface - 403禁止在zen cart错误 [英] @fontface - 403-forbidden error in zen cart

查看:346
本文介绍了@fontface - 403禁止在zen cart错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太确定这是否是正确的地方发布,因为我不知道问题在哪里。基本上字体是一个真正的痛苦我现在,没有什么工作。我试着从谷歌字体加载字体,并遇到了问题的IE,所以我决定下载它们,并自己服务,但现在它不工作在任何浏览器,我得到的错误:

I wasn't really sure if this was the right place to post this as I have no idea where the problem is. Basically fonts are a real pain for me right now and nothing is working. I have tried loading fonts from google-fonts and ran into problems with IE so i decided to download them and serve them myself but now it's not working in any browser I am getting the error:

NetworkError:403禁止 - http:/ /www.mychic.co.uk/includes/templates/SmartStart/fonts/architectsdaughter-webfont.woff
NetworkError:403禁止 - http://www.mychic.co.uk/includes/templates/SmartStart/fonts/architectsdaughter-webfont.ttf

"NetworkError: 403 Forbidden - http://www.mychic.co.uk/includes/templates/SmartStart/fonts/architectsdaughter-webfont.woff" "NetworkError: 403 Forbidden - http://www.mychic.co.uk/includes/templates/SmartStart/fonts/architectsdaughter-webfont.ttf"

我试过玩permisssions给文件的读取和执行权限,甚至尝试777和仍然得到相同的错误,字体确定他们应该在哪里,我的CSS看起来像这样:

I have tried playing with permisssions to give read and execute permissions on the files and have even tried 777 and am still getting the same error, the fonts are definately where they should be and my css looks like this:

@font-face {
    font-family: 'architects_daughterregular';
    src: url('../fonts/architectsdaughter-webfont.eot');
    src: url('../fonts/architectsdaughter-webfont.eot?#iefix') format('embedded-opentype'),
         url('../fonts/architectsdaughter-webfont.woff') format('woff'),
         url('../fonts/architectsdaughter-webfont.ttf') format('truetype'),
         url('../fonts/architectsdaughter-webfont.svg#architects_daughterregular') format('svg');
    font-weight: normal;
    font-style: normal;

}

body { font-family: 'architects_daughterregular'; }

建议我添加一个.htaccess文件,网站和字体目录(这是正确的):

It was suggested that I add an .htaccess file so i have added the following to the root of the site and the fonts directory (is this correct):

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

任何想法我在这里做错了什么 - 任何帮助/想法是非常赞赏?

Any ideas what I am doing wrong here - any help/ideas are much appreciated?

推荐答案

问题是在这里感谢我的托管提供商,我将继续信息,以最好的我可以为任何人有相同的问题:zencart已包括在includes文件夹中.htaccess文件阻止某些文件。删除这将解决问题,但也允许在服务器上运行脚本,所以最好只允许通过对应于您的字体文件的文件类型(参见添加到文件的svg,eot,woff& ttf文件类型匹配):

I have found out what the issue was here thanks to my hosting provider, I will relay the info as best I can for anyone else with the same issue: zencart has included in the includes folder an .htaccess file which blocks certain files. deleting this will solve the problem but also allows the running of scripts on the server, so better to just allow through the file types which correspond to your font files (see the svg,eot,woff &ttf file types added to the files match) :

#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 18695 2011-05-04 05:24:19Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################

# deny *everything*
<FilesMatch ".*">
  Order Allow,Deny
  Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch ".*\.(js|JS|css|CSS|jpg|JPG|gif|GIF|png|PNG|swf|SWF|xsl|XSL|svg|eot|ttf|woff)$">
  Order Allow,Deny
  Allow from all
</FilesMatch>

IndexIgnore */*


## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
# OPTIONS -Indexes -ExecCGI

这篇关于@fontface - 403禁止在zen cart错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆