Cuberic
Cuberic

Reputation: 187

website looking for font files in the wrong place

I'm trying to get a wingding style of font to work on a webserver but it's always looking for the files in the wrong place.

My file system looks like this:

/phhiv_asia_workshop_2012
|
|--index.html
|--/css
    |--global.css
    |--/fonts
       |--font.woff

I have the @font-face declaration as such:

@font-face {
font-family: 'Pictos';
src: url("/fonts/font-web.eot");
src:local('☺'), url("/fonts/font-web.woff") format("woff"), url("/fonts/font-web.ttf") format("truetype"), url("/fonts/font-web.svg#webfontIyfZbseF") format("svg");
font-weight: normal;
font-style: normal;
}

It works fine locally, but when I check it on the server it's looking for the font files:

example.com/fonts/pictos.woff example.com/fonts/pictos.woff

when the website is located at:

http://his.unhcr.org/phhiv_asia_workshop_2012/ and http://twine.unhcr.org/phhiv_asia_workshop_2012/

It works fine locally if I change the url to ("fonts/font-web.eot") but on the server it starts looking for the file at:

example.com/phhiv_asia_workshop_2012/css/global.css/fonts/pictos-web.woff/

Why does it change from looking at the root to trying to find it in css/global.css/fonts/pictos-web.woff?

(i had to use example.com because my reputation is low, but you supplement it either twine.unhcr.org or his.unhcr.org)

some other facts: twine.unhcr.org/phhiv_asia_workshop_2012/ is redirected from his.unhcr.org/phhiv_asia_workshop_2012/

I don't have access to the server so I'm trying to use a htaccess file in xampp to redirect my local files.

Upvotes: 0

Views: 276

Answers (2)

Wez
Wez

Reputation: 10712

Try using this ./fonts/font-web.woff

Upvotes: 0

sam
sam

Reputation: 10094

try using the absolute path to the font files, ie. http://www.mydomain.com/css/fonts/font-web.woff

Upvotes: 1

Related Questions