最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Icon font not working on subdomains of multisite

programmeradmin6浏览0评论

I have a multi site installation consisting of the main domain and various subdomans.

The domain and subdomain all use the one theme however the icon font of the theme doesn't display/load an any of the subdomains.

Why are subdomains of my multi-site network failing?

I have a multi site installation consisting of the main domain and various subdomans.

The domain and subdomain all use the one theme however the icon font of the theme doesn't display/load an any of the subdomains.

Why are subdomains of my multi-site network failing?

Share Improve this question asked Dec 20, 2015 at 20:47 Clarus DignusClarus Dignus 3045 silver badges16 bronze badges 5
  • 1 Have a look at the url to the font that is being displayed in your code. It might be that not the full url is being used – thebigtine Commented Dec 20, 2015 at 21:07
  • @YobdDigital The full URL is not being used. Just the the file name. – Clarus Dignus Commented Dec 20, 2015 at 21:43
  • @YobdDigital I edited the paths as full paths but it didn't work. – Clarus Dignus Commented Dec 20, 2015 at 21:49
  • 1 Could you provide a link to both sites? – thebigtine Commented Dec 20, 2015 at 22:22
  • @YobdDigital Thanks for your willingness to review the matter however it turns out the root of the issue was my CORS policy (see my answer below). – Clarus Dignus Commented Dec 21, 2015 at 0:22
Add a comment  | 

1 Answer 1

Reset to default 4

The problem:

Console log:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at xxx. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

The solution:

Add the following header to your .htaccess file:

# https://wordpress/support/topic/font-awesome-not-working?replies=8#post-4921179
# Allow icon font to load on subdomains of WordPress multisite install.

<FilesMatch ".(ttf|otf|woff)$">
    Header set Access-Control-Allow-Origin "*"
</FilesMatch>

...before:

# END WordPress
发布评论

评论列表(0)

  1. 暂无评论