开发者

Favicon probably stuck due to .htaccess

I've made a custom .htaccess file in order to work with 'clean urls' on my website, but now my favicon has stopped working. I guess that's because of my rewrite rules, but i am not sure. The favicon is placed in the root as /favicon.ico and is called for in the header of my site. This is the htaccess I use:

#rewite part
Options +FollowSymlinks
RewriteEngine On

RewriteCond %{http_host} ^theroyalinstitute.com [NC]
RewriteRule ^(.*)$ http://www.theroyalinstitute.com/$1 [L,R=301] 

AddType image/x-icon .ico 
AddType text/xml .xml
AddType application/x-woff .woff

#Etags
Header unset Pragma 
Header unset ETag
FileETag none

#Expires-header regelt de caching in de browser.
<IfModule mod_expires.c>
    ExpiresActive On

    ExpiresByType text/html A0

    ExpiresByType text/xml A60


    #One month
    ExpiresByType image/x-icon A604800

    ExpiresByType image/gif A604800
    ExpiresByType image/png A604800
    ExpiresByType image/jpeg A604800

    ExpiresByType application/x-shockwave-flash A604800

    ExpiresByType application/x-woff A2592000
    ExpiresByType application/x-javascript A2592000
    Expire开发者_Python百科sByType text/css A2592000

</IfModule>

RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^([^\.]+)/?$ index.php [L]

# compress all js & css:
AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-woff application/json
Header append Vary Accept-Encoding

Who has the answer, tip or solution?


Try changing this line:

RewriteCond %{REQUEST_URI} !=/favicon.ico

to this:

RewriteCond %{REQUEST_URI} !/favicon\.ico$


Thanks for all your comments, apparently the problem was in the CHMOD permissions instead of the whole rewrite part!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜