Font AwesomeやWebフォントが別サーバで表示されない問題の解決(クロスドメイン問題)
font awesomeって便利ですよね。ちょっとしたアイコンが手軽に使えて。でも、システム屋から見るとときに鬱陶しいことも。
とある、フロントのWebサーバと、システム遷移後のシステムサーバが別になっているシステムにて。
「フロントでは表示されているFont awesomeのアイコンが、システムページでは壊れている」
他のCSSはちゃんと参照できているのに、Font AwesomeやWeb fontが軒並み読み込まれていない。
Googleで「Font awesome 表示されない」などで検索すると、判で押したように以下のような対策が提示される。
- CSSがheaderに読み込まれていない
- Free版ではなくPro版を指定してしまっている
- font-familyに「Font Awesome 5 free」と設定していない
- font-weightを指定していない
- contentのユニコードにバックスラッシュをつけていない
多分、一般的なFont awesomeを使いたいシーンとしては上記であっているんでしょうけど、どれもフロントサーバでは実現されているので…。
あ、サーバが別だからだめなのか?と気づいて色々試した結果、次のことがわかった。
「最近のブラウザでは、ドメインが違うところからWeb Fontを読み込めないようになっている」
これを、Webフォントのクロスドメイン問題という。
解決するには、読み込まれる側のWebサーバに許可設定を仕込めばOK。
例として、webserver.com に配置したWebフォントを、systemserver.comから読み出すとして。
webserver.comのサーバの /etc/httpd/conf.d/ssl.conf に
Header set Access-Control-Allow-Origin “systemserver.com”
と記載してhttp reload。.htaccessでも大丈夫。
もし、どっからでも許可するぜウェルカム!って場合は、ドメイン部分をアスタリスクにすれば良い。
Header set Access-Control-Allow-Origin *
めでたく解決しました。
広告
Regards for helping out, еxcellent info.
Wonderful beat ! I would like to apprentice at the same time as you amend your web site, how could i
subscribe for a blog website? The account aided
me a acceptable deal. I were a little bit familiar of this your broadcast provided brilliant clear idea
Hey there great blog! Does running a blog similar to
this require a great deal of work? I have very little expertise in computer
programming however I was hoping to start my own blog soon.
Anyways, should you have any ideas or tips for new blog owners please share.
I know this is off subject but I simply wanted to ask. Thanks!
Your style is really unique compared to other people I have read stuff from.
I appreciate you for posting when you’ve got the opportunity,
Guess I’ll just bookmark this site.
Greetings! Very useful advice in this particular post!
It’s the little changes that will make the greatest changes.
Thanks for sharing!
Hi there, i read your blog from time to time and i own a similar one and i was just curious if you get a lot of spam remarks?
If so how do you stop it, any plugin or anything you
can suggest? I get so much lately it’s driving me crazy so any help is very much appreciated.
It’s hard to find experienced people on this topic, however,
you sound like you know what you’re talking about!
Thanks
Saved as a favorite, I really like your website!
Having read this I believed it was very enlightening. I appreciate you
spending some time and energy to put this content together.
I once again find myself personally spending way too much time both reading and
leaving comments. But so what, it was still worth it!
Great blog here! Also your website quite a bit up
very fast! What web host are you the use of? Can I am getting your affiliate hyperlink to your
host? I want my web site loaded up as fast as yours lol.
What’s up, constantly i used to check weblog posts here early in the daylight, since i enjoy
to find out more and more.
There is definately a great deal to learn about this topic.
I love all the points you made.
Om danska folket hade fått bestämma skulle Det Kongelige Teater i Köpenhamn få bomma igen.
Ridiculous quest there. What occurred after? Take care!
Hello there! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying to get my blog to rank for some targeted
keywords but I’m not seeing very good success.
If you know of any please share. Many thanks!
Där hittar du allt du behöver veta om Videoslots som dess bonusregler, spelleverantörer, betalningsmetoder med mera.
Det och mycket mer kommer ni alltså att kunna läsa om senare i vår casinorecension som handlar om 7Sultans Casino.
Omdat wij werken met innovatieve technieken, kunnen we ook hardere edelmetalen graveren en zijn moderne designs ook geen probleem.
Wow a lot of beneficial data!
Deze
Wat is het verschil in uitstraling tussen witgoud en zilver?
Alle zegelringen worden ambachtelijk gemaakt door onze ervaren heraldisch edelsmid.
You can sign up with DraftKings to take advantage of their free bet offer.
This made retail, mobile and online sports betting legal, and since then, several additional legal Massachusetts sports betting operators have launched.
You reported this terrifically!
You reported that terrifically.
Your user experience will vary, but it depends largely on your aesthetic preferences.
Positive user feedback, although limited due to the platform’s recent launch, emphasizes the strengths of Huge Win Casino.
Hi there very nice website!! Man .. Excellent .. Wonderful ..
I will bookmark your web site and take the feeds additionally?
I’m happy to search out numerous useful info right here in the
publish, we need work out more strategies on this regard, thanks for sharing.
. . . . .
För information om deras utbetalning, kontakta respektive casino.
Förutom välkomstbonus har Magic Red ett lojalitetsprogram, och det ser vi alltid som något positivt!
Great tips Thanks!
So if you’ve chosen a fiat currency at the beginning and later switched it to crypto, you would still have to give your personal information.
Som vårt namn antyder så är vårt mål attgöra dig till en blackjackstjärna.
Zorg wel voor minimaal 50 cm ruimte tussen de rand van het kleed en de tafel.
Det är kul när man vill prova på något nytt, men samtidigt saknade vi en del titlar, speciellt bland de progressiva jackpottarna.
My partner and I stumbled over here different web address and thought I may as well check things out.
I like what I see so now i am following you. Look forward to looking into your web page yet again.
Vi är ett gäng spelare som vill hjälpa erandra spelare genom att förse er med bra fakta så att ni kan fatta bra beslut iert spelande.
Cool + for the post
_________________
[URL=https://igra.topslotgames.lat]free spins promo code[/URL]