<p>My issue was that the assets files were in the same folder as the twig template files. Moving the files to the <code>web</code> folder solved the issue.</p>

CC BY-SA 3.0
2018-03-14T09:09:03.443Z
Your issue was that your @font-face statement was wrong, it was instructing the browser to load the files from a location where they did not exist.
Seth Warburton
CC BY-SA 3.0
2018-03-14T15:24:44.927Z
Nope, it was not a 404, its seems that Craft somehow wanted to render the file as a template.
nmsdvid
CC BY-SA 3.0
2018-03-12T12:11:05.447Z
2018-03-12T12:11:05.447Z
nmsdvid
<p>I'm having trouble to load an ttf and a woff file in Craft 3. I'm getting an error 500. The files exists and when trying to access it via the browser it shows: Twig Syntax Error – Twig_Error_Syntax Unexpected character "" for both of the files. Any suggestions ?</p>

CC BY-SA 3.0
2018-03-11T21:33:47.517Z
Instead of letting us guess what the issue might be it would be more useful to show us your code and your file structure.
Robin Schambach
CC BY-SA 3.0
2018-03-12T08:15:32.297Z
Hey Robin, There is nothing fancy going on actually. Just have a css style which is loading ttf and woff files. The chrome debugger shows error 500 and when i'm opening the file in the browser twig shows an error Twig Syntax Error – Twig_Error_Syntax Unexpected character "". Can it be some htaccess or twig error settings error ?
nmsdvid
CC BY-SA 3.0
2018-03-12T08:24:36.497Z
Most likely you didn't include them properly thus we need the code
Robin Schambach
CC BY-SA 3.0
2018-03-12T08:27:40.587Z
This is how i'm loading the icon font: @font-face{
    font-family:icomoon;
    src:url(54da533830dd0c1910ac66aa608c303a.eot);
    src:url(54da533830dd0c1910ac66aa608c303a.eot) format("embedded-opentype"),url(f1d29a50c6ddc22d39bd7e3f0e5ce345.ttf) format("truetype"),url(ee2c51fe7b99ae8ee7a1e64c6dcf77d7.woff) format("woff"),url(00f344a009ddb271ecd750817ffdeee1.svg) format("svg");
}
nmsdvid
CC BY-SA 3.0
2018-03-12T08:34:01.913Z
Do you have your files directly next to your index.php`? Because that's where your code searches them
Robin Schambach
CC BY-SA 3.0
2018-03-12T11:09:59.270Z
no, the assets are in the templates folder. I'm also loading css and js files and those are correct.
nmsdvid
CC BY-SA 3.0
2018-03-12T11:27:50.630Z
That's why we need to see your folder structure. CSS and JS files should not be in your templates folder. Because only your web folder is accessable via normal URL you should put those files into your web folder in order to access them via public urls
Robin Schambach
CC BY-SA 3.0
2018-03-12T11:43:50.743Z
Thx Robin, the hint that the assets can't be in the same folder as the templates fixed my issue. Thx for your help.
nmsdvid
CC BY-SA 3.0
2018-03-12T12:29:52.083Z
That's why you should always provide more information. We ask certain things for good reasons
Robin Schambach
<craft3>
Error 500 on ttf and woff files
# Error 500 on ttf and woff files

(Asked by: username_0 on 2018-03-11)

I'm having trouble to load an ttf and a woff file in Craft 3. I'm getting an error 500. The files exists and when trying to access it via the browser it shows: Twig Syntax Error – Twig\_Error\_Syntax Unexpected character "" for both of the files. Any suggestions ?

**Tags:** craft3
> **Comments:**
> **username_1**: Instead of letting us guess what the issue might be it would be more useful to show us your code and your file structure.  
> **username_0**: Hey Robin, There is nothing fancy going on actually. Just have a css style which is loading ttf and woff files. The chrome debugger shows error 500 and when i'm opening the file in the browser twig shows an error Twig Syntax Error – Twig_Error_Syntax Unexpected character "". Can it be some htaccess or twig error settings error ?  
> **username_1**: Most likely you didn't include them properly thus we need the code  
> **username_0**: This is how i'm loading the icon font: @font-face{     font-family:icomoon;     src:url(54da533830dd0c1910ac66aa608c303a.eot);     src:url(54da533830dd0c1910ac66aa608c303a.eot) format("embedded-opentype"),url(f1d29a50c6ddc22d39bd7e3f0e5ce345.ttf) format("truetype"),url(ee2c51fe7b99ae8ee7a1e64c6dcf77d7.woff) format("woff"),url(00f344a009ddb271ecd750817ffdeee1.svg) format("svg"); }  
> **username_1**: Do you have your files directly next to your index.php`? Because that's where your code searches them  
> **username_0**: no, the assets are in the templates folder. I'm also loading css and js files and those are correct.  
> **username_1**: That's why we need to see your folder structure. CSS and JS files should not be in your templates folder. Because only your web folder is accessable via normal URL you should put those files into your web folder in order to access them via public urls  
> **username_0**: Thx Robin, the hint that the assets can't be in the same folder as the templates fixed my issue. Thx for your help.  
> **username_1**: That's why you should always provide more information. We ask certain things for good reasons  

---

## 1 answers

### Answer by username_0 on 2018-03-12. Score: 1

My issue was that the assets files were in the same folder as the twig template files. Moving the files to the `web` folder solved the issue.

> **Comments:**
> **username_2**: Your issue was that your @font-face statement was wrong, it was instructing the browser to load the files from a location where they did not exist.  
> **username_0**: Nope, it was not a 404, its seems that Craft somehow wanted to render the file as a template.  

---

