@fontface - 禅车403-禁止错误(@fontface - 403-forbidden

2019-09-21 10:01发布

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

“NetworkError:403禁止- http://www.mychic.co.uk/includes/templates/SmartStart/fonts/architectsdaughter-webfont.woff ”“NetworkError:403禁止- http://www.mychic.co.uk/包括/模板/ SmartStart的/字体/ architectsdaughter-webfont.ttf “

我曾尝试与permisssions给的文件读取和执行权限玩,甚至试过777和我仍然得到同样的错误,字体是肯定,他们应该和我的CSS是这样的:

@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文件,所以我增加了以下的站点的根和fonts目录(这是正确的):

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

任何想法,我做错了这里 - 任何帮助/想法大加赞赏?

Answer 1:

我已经发现了什么问题在这里感谢我的托管服务提供商,我会尽我所能中继信息用于其他任何人同样的问题:ZENCART已包含在包括文件夹.htaccess文件阻断某些文件。 删除这将解决这个问题,但也允许在服务器上脚本的运行,所以最好只允许通过它符合您的字体文件(见SVG,EOT,WOFF与TTF文件类型添加到文件相匹配)的文件类型:

#
# @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-forbidden error in zen cart