Using fonts, Fontawesome and another with React served through Apache 2.4.x

Posted June 28, 2020 60 views

I’ve created a React app connecting to a back end Rails API. Everything works great on my local machine when running react using the bundled development server. When I deployed to my Apache server it works but I have 2 issues.

  1. The icons from Fontawesome are not showing up.
  2. I use the Poppins font and while it looks like it’s being used, the view is showing me a different size from that running through my development server.

I’m sure there’s some deployment options I’m missing. Searching SO showed me to embed a link to fontawesome and add to .htaccess.

Added this to my index.html:

<link href="http://localhost:8080/files/applications/CADRe/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">

Added this to my .htaccess file:

AddType application/ eot
AddType font/truetype ttf
AddType application/x-font-woff woff

Thanks in advance.

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!