Search code examples
phpapache.htaccessglyphiconsnette

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.


Solution

  • 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.