• Home
  • About 404TS
  • Contact

404 Tech Support

Where IT Help is Found

  • Articles
    • Code
    • Entertainment
    • Going Green
    • Hardware, Gadgets, and Products
    • Management
    • Network
    • News
    • Operating Systems
    • Security and Privacy
    • Software
    • System Administration
    • Talking Points
    • Tech Solutions
    • Web
    • Webmaster
  • Reviews
  • Media
    • Infographics
    • Videos
  • Tech Events
  • Tools
    • How do I find my IP address?
    • Browser and plugin tests
  • Get a Technical Consultation
You are here: Home / Articles / Webmaster / Making Font Awesome, CloudFront, and Firefox play nice

Making Font Awesome, CloudFront, and Firefox play nice

2013-07-02 by Jason

This new theme utilizes FontAwesome, an iconic font, to adapt to new locations and devices more easily. For example, the search magnifying glass, the RSS feed icon, and a few other icons around the site come from FontAwesome.

fontawesome_example

I use Chrome as my default browser and all looked well and good there. When I was checking over the site in other browsers like Firefox and IE I noticed that the icons were not showing up. They were replaced with a box containing F002 and other characters. (Zoomed in to make it a little easier to see.)

Font Awesome broken example

Inspecting the element in the Firefox console showed the following error trying to access the font file (the FontAwesome .eot, .ttf, .otf, or .woff): bad URI or cross-site access not allowed

Testing things out, I narrowed the problem down to when I enabled the caching plugin, specifically the CDN component. I am using Amazon Web Services CloudFront as my CDN with a direct origin-pull connection. From everything I could find online, the problem came from Firefox having strict settings and CloudFront not being able to be configured with CORS. One of the first suggested solutions I found was an update to the problem finding that Amazon had enabled CORS on their S3 buckets. I didn’t want to complicate my setup by including S3 in the equation, so I kept looking.

I tried excluding the various font formats from the CDN through my caching plugin but apparently the way it was being called, the exclusion had no effect. I found that NetDNA provides a free Bootstrap CDN which includes serving Font Awesome. Their page provides you the information to include their hosted CSS file. Unfortunately, including it in my site’s header did not solve the problem. I dissected their indicated CSS file to find the path to the font files. I then hard-coded those paths into my original CSS file instead of pulling a relative path on my CDN. The path for the .eot file, for example: http://netdna.bootstrapcdn.com/font-awesome/3.2.1/font/fontawesome-webfont.eot

This ended up working well across browsers and did not have the cache header problem that CloudFront did. Unfortunately, with the CSS file cached on CloudFront, I would have to invalidate the file before the change could take effect. I would also have to keep up with BootstrapCDN updates in the future. While I was waiting for the file to invalidate, I found another solution in a tab to StackOverflow I had opened earlier. There, user Styu provided the following code to add to your .htaccess file.

[text]
<FilesMatch ".(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
[/text]

It solved the problem right away. After CloudFront finished invalidating the CSS file, I removed this fix and tested both individually to confirm they each worked. Right now, I have both solutions in place but plan on going down to just the .htaccess solution when the next theme update replaces my changes using the BootstrapCDN font files.

WordPress Plugin

If you would like to use Font Awesome within WordPress but your theme doesn’t include it, you can use the WordPress plugin AwesomePress to make Font Awesome available.

awesomepress

With this plugin, you can access the full set of icons within the font using HTML, PHP template codes, and shortcodes. Then, you would be able to accomplish something like this:

and many more.

Filed Under: Webmaster

Trending

  • Malwarebytes introduces Techbench, a USB utility to remove malware
    In Security and Privacy
  • How to stop the Windows XP End of Service reminders
    In Operating Systems, Tech Solutions
  • Dual Monitor vs Ultra-Wide Monitor: Which is Better?
    In Hardware, Gadgets, and Products

Latest Media Posts

Find Out Where To Download SNES ROMs

Find Out Where To Download SNES ROMs

Multifunctional Video Conversion Tools – Wondershare Video Converter

Multifunctional Video Conversion Tools – Wondershare Video Converter

  • Popular
  • Latest
  • Today Week Month All
  • Access to the resource [servershare] has been disallowed Access to the resource [servershare] has been disallowed
  • Read the Event Logs on Windows Server Core Read the Event Logs on Windows Server Core
  • Increase IIS Private Memory Limit to improve WSUS availability Increase IIS Private Memory Limit to improve WSUS availability
  • How to ‘Unblock’ multiple files at a time with PowerShell How to 'Unblock' multiple files at a time with PowerShell
  • Setup your DFS namespace with DNS for compatibility in a mixed environment Setup your DFS namespace with DNS for compatibility in a mixed environment
  • How Virtual Reality Supports Mental Health Therapy How Virtual Reality Supports Mental Health Therapy
  • Key Strategies of Successful Coin Listing on Exchange Key Strategies of Successful Coin Listing on Exchange
  • Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting
  • Making Distributed Software Development Work: Strategies and Best Practices for Managing Remote Teams Making Distributed Software Development Work: Strategies and Best Practices for Managing Remote Teams
  • customer contactless payment for drink with mobile phon at cafe counter bar,seller coffee shop accept payment by mobile.new normal lifestyle concept The Latest Innovations In Payment Technology
Ajax spinner

Elevator Pitch

404 Tech Support documents solutions to IT problems, shares worthwhile software and websites, and reviews hardware, consumer electronics, and technology-related books.

Subscribe to 404TS articles by email.

Recent Posts

  • How Virtual Reality Supports Mental Health Therapy
  • Key Strategies of Successful Coin Listing on Exchange
  • Keeping Your Mac Healthy: A Comprehensive Guide to Maintenance and Troubleshooting

Search

FTC Disclaimer

404TechSupport is an Amazon.com affiliate; when you click on an Amazon link from 404TS, the site gets a cut of the proceeds from whatever you buy. This site also uses Skimlinks for smart monetization of other affiliate links.
Use of this site requires displaying and viewing ads as they are presented.

Copyright © 2025 · Magazine Pro Theme on Genesis Framework · WordPress · Log in