Kudlas
Kudlas

Reputation: 659

Bootstrap 3 glyphicons are 403 forbidden

I am using Nette Framework 2.2.1 and BootStrap 3 on Wamp 2.5 (Win7). I am not able to load glyphicons in browser (error 403 Forbidden).

what browser sees enter image description here

all needed fonts are in folder C:\wamp\www\nette\www\fonts\

.htaccess is located in C:\wamp\www\nette\www\ with content

<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>

# enable cool URL
<IfModule mod_rewrite.c>
    RewriteEngine On
    # RewriteBase /

    # prevents files starting with dot to be viewed by browser
    RewriteRule /\.|^\. - [F]

    # front controller
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule !\.(eot|svg|ttf|woff|pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz)$ index.php [L]
</IfModule>

C:\wamp\www\nette\www\bootstrap.min.css contains

@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}

Apache error log:

[Wed Jul 16 11:55:01.004757 2014] [core:error] [pid 3812:tid 788] (OS 5)Access is denied. : [client 127.0.0.1:52031] AH00132: file permissions deny server access: C:/wamp/www/nette/www/fonts/glyphicons-halflings-regular.svg, referer: http://www.nette.local/arts/porta-quis-ligula

I tried to set all permissions for user everyone to folder fonts, but its not working anyway.

Upvotes: 0

Views: 3092

Answers (2)

Ali Gangji
Ali Gangji

Reputation: 1501

Check that your font files are readable by the user apache is running as.

It's important that the font files themselves be readable, in addition to the directory they are in.

Upvotes: 1

Pavel Lauko
Pavel Lauko

Reputation: 66

You have fonts in C:\wamp\www\nette\www\fonts,

and css file in the same folder C:\wamp\www\nette\www as folder fonts (C:\wamp\www\nette\www\bootstrap.min.css ).

But in css file is @font-face{font-family:'Glyphicons Halflings';src:url(../fonts/ ... so bootstrap css expects all fonts in folder C:\wamp\www\nette\fonts (one level above)

You can move css file to folder like "C:\wamp\www\nette\www\styles", "C:\wamp\www\nette\www\css" or something like that, so path to fonts will match, or change paths in css file. I recommend the first way.

Upvotes: 1

Related Questions