# Fonts 404 error \[solved\]

**URL:** https://discourse.gohugo.io/t/fonts-404-error-solved/15447
**Category:** Uncategorized
**Created:** [November 22, 2018, 5:10pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447 "2018-11-22T17:10:18Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jswtch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jswtch/32/8984_2.png) [@jswtch](https://discourse.gohugo.io/u/jswtch)
#### Post date: [November 22, 2018, 5:10pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/1 "2018-11-22T17:10:19Z")

</div>

Hello,

My site: [https://2018-fonttest.netlify.com](https://2018-fonttest.netlify.com)

I am trying to add some fonts to a website. They appear to load correctly in chrome, however, I get 404 errors saying the files are missing. They do appear in firefox without console errors. I am using the netlify victor-hugo boilerplate. [https://github.com/netlify-templates/victor-hugo](https://github.com/netlify-templates/victor-hugo)

The font stylesheets are being imported into the main.css. The following pictures show the project structure and css.

main.css  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/c/c3ccbb7f2112cb59563bfe6d120d3eb34ffb3429.png)

project tree

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/7/7e87eac60f96adfe1180adb6395a65e56d8a4995.png)

font stylesheet

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/9/98f210d8e0f1777c1368ea8e853c76dc54b94373.png)

---

<div class="post-metadata">

### Author: ![Weru](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/weru/32/7300_2.png) [@Weru](https://discourse.gohugo.io/u/Weru)
#### Post date: [November 23, 2018, 11:57am UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/2 "2018-11-23T11:57:50Z")

</div>

Hello, could you try using /fonts/ instead of …/fonts? Make sure the fonts directory is at the root level of your static assets directory

---

<div class="post-metadata">

### Author: ![RickCogley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/rickcogley/32/10269_2.png) [@RickCogley](https://discourse.gohugo.io/u/RickCogley)
#### Post date: [November 23, 2018, 12:05pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/3 "2018-11-23T12:05:17Z")

</div>

I’m not sure the assumption you’re using for that path will work. Like @Weru says, put your fonts in `/static` in your project (under “site” for you I think), which gets merged by Hugo to the root of your site on publish.

Reference the files accordingly.

---

<div class="post-metadata">

### Author: ![jswtch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jswtch/32/8984_2.png) [@jswtch](https://discourse.gohugo.io/u/jswtch)
#### Post date: [December 27, 2018, 2:43pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/5 "2018-12-27T14:43:36Z")

</div>

I have all the font files in /static/fonts/ folder

All the files are copied over to /dist/fonts/ folder

I have my @font-face in the main.css as follows

```auto
@font-face {
  font-family: 'my-font';
  src: url("/fonts/my-font");
  src: url("/fonts/my-font") format('embedded-opentype'),
    url("/fonts/my-font") format('woff'),
    url("/fonts/my-font") format('truetype'),
    url("/fonts/my-font") format('svg');
  font-weight: bold;
  font-style: normal;
}

```

My command line says source is compiled without error.

However, the fonts are not displayed, and there are no font files under ‘sources’ tab of the chrome dev tools.

But if I go to url/fonts/my-font.woff the file actually downloads to the browser.

---

<div class="post-metadata">

### Author: ![zwbetz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zwbetz/32/16088_2.png) [@zwbetz](https://discourse.gohugo.io/u/zwbetz)
#### Post date: [December 27, 2018, 3:45pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/6 "2018-12-27T15:45:29Z")

</div>

Please don’t open multiple topics for the [same issue](https://discourse.gohugo.io/t/fonts-404-error/15447).

If you would like folks to help you, give [requesting help](https://discourse.gohugo.io/t/requesting-help/9132) a read, then post a link to a git repo.

---

<div class="post-metadata">

### Author: ![jswtch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jswtch/32/8984_2.png) [@jswtch](https://discourse.gohugo.io/u/jswtch)
#### Post date: [December 28, 2018, 1:26pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/7 "2018-12-28T13:26:55Z")

</div>

thanks

---

<div class="post-metadata">

### Author: ![jswtch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jswtch/32/8984_2.png) [@jswtch](https://discourse.gohugo.io/u/jswtch)
#### Post date: [December 28, 2018, 1:28pm UTC](https://discourse.gohugo.io/t/fonts-404-error-solved/15447/8 "2018-12-28T13:28:03Z")

</div>

fixed - css issue
