Htaccess阻止字体真棒Web字体?


只怕再见是故人
2025-04-04 08:53:28 (4天前)

1个

我相信htaccess文件中的某些内容阻止了Webfonts在我的网站上显示。我不是100%对此,但是我已经禁用了安全性插件以及我网站上的所有内容,并且这种情况仍在发生。想知道是否有经验更丰富的人会有所启发?

这些是我遇到的错误(访问链接会导致403错误):

可下载的字体:下载失败(字体家族:“ FontAwesome”样式:正常重量:正常拉伸:正常src索引:1):status = 2147746065来源:http ://brandonmoner.me/wp-content/plugins/bean-shortcodes /assets/font/fontawesome-webfont.woff?v=3.1.0 bean-shortcodes.css

可下载的字体:下载失败(字体家族:“ FontAwesome”样式:正常重量:正常拉伸:正常src指数:2):status = 2147746065来源:http ://brandonmoner.me/wp-content/plugins/bean-shortcodes /assets/font/fontawesome-webfont.ttf?v=3.1.0 bean-shortcodes.css

到目前为止,这是我的htaccess中的内容:


  1. # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUESTFILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]


    # END WordPress

    # TURN OFF YOUR SERVER SIGNATURE
    ServerSignature Off

    # BEGIN GZIP

    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html

    # END GZIP

    # BEGIN EXPIRE HEADERS

    ExpiresActive On
    ExpiresDefault access plus 5 seconds
    ExpiresByType image/x-icon access plus 2592000 seconds
    ExpiresByType image/jpeg access plus 2592000 seconds
    ExpiresByType image/png access plus 2592000 seconds
    ExpiresByType image/gif access plus 2592000 seconds
    ExpiresByType application/x-shockwave-flash access plus 2592000 seconds
    ExpiresByType text/css access plus 604800 seconds
    ExpiresByType text/javascript access plus 216000 seconds
    ExpiresByType application/javascript access plus 216000 seconds
    ExpiresByType application/x-javascript access plus 216000 seconds
    ExpiresByType text/html access plus 600 seconds
    ExpiresByType application/xhtml+xml access plus 600 seconds

    # END EXPIRE HEADERS

    # BEGIN CACHE-CONTROL HEADERS


    Header set Cache-Control public


    Header set Cache-Control public


    Header set Cache-Control private


    Header set Cache-Control private, must-revalidate


    # END CACHE-CONTROL HEADERS

    # DO NOT SHOW DIRECTORY LISTING
    # If you are getting 500 Errors then comment out Options -Indexes
    # by adding a # sign in front of it. If there is a typo anywhere in this file you will also see 500 errors.
    Options -Indexes

    # DIRECTORY INDEX FORCE INDEX.PHP
    # Use index.php as default directory index file
    # index.html will be ignored will not load.
    DirectoryIndex index.php index.html /index.php

    # DENY ACCESS TO PROTECTED SERVER FILES AND FOLDERS
    # Files and folders starting with a dot: .htaccess, .htpasswd, .errordocs, .logs
    RedirectMatch 403 .(htaccess|htpasswd|errordocs|logs)$

    # WP-ADMIN/INCLUDES
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteRule ^wp-includes/[^/]+.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]

    # WP REWRITE LOOP START
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]

    # REQUEST METHODS FILTERED
    # This filter is for blocking junk bots and spam bots from making a HEAD request, but may also block some
    # HEAD request from bots that you want to allow in certains cases. This is not a security filter and is just
    # a nuisance filter. This filter will not block any important bots like the google bot. If you want to allow
    # all bots to make a HEAD request then remove HEAD from the Request Method filter.
    # The TRACE, DELETE, TRACK and DEBUG request methods should never be allowed against your website.
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK|DEBUG) [NC]
    RewriteRule ^(.)$ - [F,L]

    # PLUGINS/THEMES AND VARIOUS EXPLOIT FILTER SKIP RULES
    # IMPORTANT!!! If you add or remove a skip rule you must change S= to the new skip number
    # Example: If RewriteRule S=5 is deleted than change S=6 to S=5, S=7 to S=6, etc.

    # Adminer MySQL management tool data populate
    RewriteCond %{REQUEST_URI} ^/wp-content/plugins/adminer/ [NC]
    RewriteRule . - [S=12]
    # Comment Spam Pack MU Plugin - CAPTCHA images not displaying
    RewriteCond %{REQUEST_URI} ^/wp-content/mu-plugins/custom-anti-spam/ [NC]
    RewriteRule . - [S=11]
    # Peters Custom Anti-Spam display CAPTCHA Image
    RewriteCond %{REQUEST_URI} ^/wp-content/plugins/peters-custom-anti-spam-image/ [NC]
    RewriteRule . - [S=10]
    # Status Updater plugin fb connect
    RewriteCond %{REQUEST_URI} ^/wp-content/plugins/fb-status-updater/ [NC]
    RewriteRule . - [S=9]
    # Stream Video Player - Adding FLV Videos Blocked
    RewriteCond %{REQUEST_URI} ^/wp-content/plugins/stream-video-player/ [NC]
    RewriteRule . - [S=8]
    # XCloner 404 or 403 error when updating settings
    RewriteCond %{REQUEST_URI} ^/wp-content/plugins/xcloner-backup-and-restore/ [NC]
    RewriteRule . - [S=7]
    # BuddyPress Logout Redirect
    RewriteCond %{QUERY_STRING} action=logout&redirect_to=http%3A%2F%2F(.
    ) [NC]
    RewriteRule . - [S=6]
    # redirect_to=
    RewriteCond %{QUERY_STRING} redirect_to=(.) [NC]
    RewriteRule . - [S=5]
    # Login Plugins Password Reset And Redirect 1
    RewriteCond %{QUERY_STRING} action=resetpass&key=(.
    ) [NC]
    RewriteRule . - [S=4]
    # Login Plugins Password Reset And Redirect 2
    RewriteCond %{QUERY_STRING} action=rp&key=(.) [NC]
    RewriteRule . - [S=3]

    # TIMTHUMB FORBID RFI and MISC FILE SKIP/BYPASS RULE
    # Only Allow Internal File Requests From Your Website
    # To Allow Additional Websites Access to a File Use [OR] as shown below.
    # RewriteCond %{HTTP_REFERER} ^.
    YourWebsite.com. [OR]
    # RewriteCond %{HTTP_REFERER} ^.
    AnotherWebsite.com.
    RewriteCond %{QUERY_STRING} ^.
    (http|https|ftp)(%3A|:)(%2F|/)(%2F|/)(w){0,3}.?(blogger|picasa|blogspot|tsunami|petapolitik|photobucket|imgur|imageshack|wordpress.com|img.youtube|tinypic.com|upload.wikimedia|kkc|start-thegame).$ [NC,OR]
    RewriteCond %{THE_REQUEST} ^.
    (http|https|ftp)(%3A|:)(%2F|/)(%2F|/)(w){0,3}.?(blogger|picasa|blogspot|tsunami|petapolitik|photobucket|imgur|imageshack|wordpress.com|img.youtube|tinypic.com|upload.wikimedia|kkc|start-thegame).$ [NC]
    RewriteRule .
    index.php [F,L]
    RewriteCond %{REQUEST_URI} (timthumb.php|phpthumb.php|thumb.php|thumbs.php) [NC]
    RewriteCond %{HTTP_REFERER} ^.brandonmoner.me.
    RewriteRule . - [S=1]

    # BEGIN QUERY STRING EXPLOITS
    # The libwww-perl User Agent is forbidden - Many bad bots use libwww-perl modules, but some good bots use it too.
    # Good sites such as W3C use it for their W3C-LinkChecker.
    # Add or remove user agents temporarily or permanently from the first User Agent filter below.
    # If you want a list of bad bots / User Agents to block then scroll to the end of this file.
    RewriteCond %{HTTP_USER_AGENT} (havij|libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} (%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    RewriteCond %{HTTP_USER_AGENT} (;|<|>|’|”|)|(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
    RewriteCond %{THE_REQUEST} \?\ HTTP/ [NC,OR]
    RewriteCond %{THE_REQUEST} \/\
    \ HTTP/ [NC,OR]
    RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
    RewriteCond %{THE_REQUEST} cgi-bin [NC,OR]
    RewriteCond %{THE_REQUEST} (%0A|%0D|\r|\n) [NC,OR]
    RewriteCond %{REQUEST_URI} owssvr.dll [NC,OR]
    RewriteCond %{HTTP_REFERER} (%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    RewriteCond %{HTTP_REFERER} .opendirviewer. [NC,OR]
    RewriteCond %{HTTP_REFERER} users.skynet.be.* [NC,OR]
    RewriteCond %{QUERY_STRING} [a-zA-Z0-9
    ]=http:// [NC,OR]
    RewriteCond %{QUERYSTRING} [a-zA-Z0-9]=(..//?)+ [NC,OR]
    RewriteCond %{QUERYSTRING} [a-zA-Z0-9]=/([a-z0-9.]//?)+ [NC,OR]
    RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
    RewriteCond %{QUERY_STRING} (../|%2e%2e%2f|%2e%2e/|..%2f|%2e.%2f|%2e./|.%2e%2f|.%2e/) [NC,OR]
    RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
    RewriteCond %{QUERY_STRING} http\: [NC,OR]
    RewriteCond %{QUERY_STRING} https\: [NC,OR]
    RewriteCond %{QUERY_STRING} \=|w| [NC,OR]
    RewriteCond %{QUERY_STRING} ^(.)/self/(.)$ [NC,OR]
    RewriteCond %{QUERY_STRING} ^(.)cPath=http://(.)$ [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).script.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^s]s)+cript.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).embed.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^e]e)+mbed.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).object.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^o]o)+bject.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (\<|%3C).iframe.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|%3C)([^i]i)+frame.(>|%3E) [NC,OR]
    RewriteCond %{QUERY_STRING} base64_encode.(.) [NC,OR]
    RewriteCond %{QUERY_STRING} base64
    (en|de)code[^(]([^)]) [NC,OR]
    RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2}) [OR]
    RewriteCond %{QUERY_STRING} ^.((|)|<|>|%3c|%3e). [NC,OR]
    RewriteCond %{QUERY_STRING} ^.(\x00|\x04|\x08|\x0d|\x1b|\x20|\x3c|\x3e|\x7f). [NC,OR]
    RewriteCond %{QUERY_STRING} (NULL|OUTFILE|LOAD_FILE) [OR]
    RewriteCond %{QUERY_STRING} (.{1,}/)+(motd|etc|bin) [NC,OR]
    RewriteCond %{QUERY_STRING} (localhost|loopback|127.0.0.1) [NC,OR]
    RewriteCond %{QUERY_STRING} (<|>|’|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
    RewriteCond %{QUERY_STRING} concat[^(]( [NC,OR]
    RewriteCond %{QUERY_STRING} union([^s]
    s)+elect [NC,OR]
    RewriteCond %{QUERY_STRING} union([^a]a)+ll([^s]s)+elect [NC,OR]
    RewriteCond %{QUERY_STRING} -[sdcr].(allow_url_include|allow_url_fopen|safe_mode|disable_functions|auto_prepend_file) [NC,OR]
    RewriteCond %{QUERY_STRING} (;|<|>|’|”|)|%0A|%0D|%22|%27|%3C|%3E|%00).
    (/*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
    RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
    RewriteRule ^(.)$ - [F,L]
    # END QUERY STRING EXPLOITS
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # WP REWRITE LOOP END

    # DENY BROWSER ACCESS TO THESE FILES
    # wp-config.php, bb-config.php, php.ini, php5.ini, readme.html
    # Replace Allow from 88.77.66.55 with your current IP address and remove the
    # pound sign # from in front of the Allow from line of code below to access these
    # files directly from your browser.


    Order allow,deny
    Deny from all
    #Allow from 88.77.66.55


    # BLOCK HOTLINKING TO IMAGES
    # To Test that your Hotlinking protection is working visit http://altlab.com/htaccess_tutorial.html
    #RewriteEngine On
    #RewriteCond %{HTTP_REFERER} !^https?://(www.)?brandonmoner.me [NC]
    #RewriteCond %{HTTP_REFERER} !^$
    #RewriteRule .
    .(jpeg|jpg|gif|bmp|png)$ - [F]

这里有什么想法吗?

2 条回复
  1. 1# 春风助手 | 2020-08-21 16-51

    您的.htaccess文件应仅控制对您网站的访问。如果你得到一个403错误将一个外部网站,很可能是他们在阻止你出于某种原因。也许他们认为您正在尝试抓取/批量加载他们的网站,或者您来自不允许的IP地址,或者您的用户代理位于禁止列表之类。您可能必须询问其他站点有关它们设置的限制。如果他们试图阻止其资源的“热链接”也就不足为奇了。

登录 后才能参与评论