XF 2.2 Font Awesome Setup - 404 Redirect error?

Gsk8

Active member
HI all! Just wondering if there is an update for the font_awesome_setup template? My current one is logging 404 redirect errors. Here is my current script. Is it wrong or outdated?

<xf:set var="$faVersion">5.15.3</xf:set>

<xf:if is="fa_weight() == 'l'">
<link rel="preload" href="{{ base_url('styles/fonts/fa/fa-light-300.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
<xf:elseif is="fa_weight() == 'r'" />
<link rel="preload" href="{{ base_url('styles/fonts/fa/fa-regular-400.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
<xf:elseif is="fa_weight() == 's'" />
<link rel="preload" href="{{ base_url('styles/fonts/fa/fa-solid-900.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
</xf:if>
<xf:if is="fa_weight() != 's'">
<link rel="preload" href="{{ base_url('styles/fonts/fa/fa-solid-900.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
</xf:if>

<link rel="preload" href="{{ base_url('styles/fonts/fa/fa-brands-400.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
 
Check your server.... since your are serving those fonts from your local install, that's what is giving you the 404 error.
This is my 2.2.13 installed template
Code:
<xf:set var="$faVersion">5.15.3</xf:set>

<xf:if is="fa_weight() == 'l'">
    <link rel="preload" href="{{ base_url('styles/fonts/fa/fa-light-300.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
<xf:elseif is="fa_weight() == 'r'" />
    <link rel="preload" href="{{ base_url('styles/fonts/fa/fa-regular-400.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
<xf:elseif is="fa_weight() == 's'" />
    <link rel="preload" href="{{ base_url('styles/fonts/fa/fa-solid-900.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
</xf:if>
<xf:if is="fa_weight() != 's'">
    <link rel="preload" href="{{ base_url('styles/fonts/fa/fa-solid-900.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
</xf:if>

<link rel="preload" href="{{ base_url('styles/fonts/fa/fa-brands-400.woff2?_v=' . $faVersion) }}" as="font" type="font/woff2" crossorigin="anonymous" />
Are you on shared hosting or a VPS/dedicated installation... got a feeling something has changed some permissions.
 
Top Bottom