我已经制作了一个自定义的.htaccess文件,以便在我的网站上使用“干净的urls”,但现在我的收藏图标已经停止工作。我猜这是因为我的重写规则,但我不确定。favicon作为/favicon.ico放置在根目录中,并在my site的页眉中调用。这是我使用的htaccess:
#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
ExpiresByType 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谁有答案,提示或解决方案?
发布于 2010-12-22 22:34:46
尝试更改此行:
RewriteCond %{REQUEST_URI} !=/favicon.ico要这样做:
RewriteCond %{REQUEST_URI} !/favicon\.ico$发布于 2010-12-22 22:47:49
谢谢你的评论,显然问题出在CHMOD权限而不是整个重写部分!
https://stackoverflow.com/questions/4510094
复制相似问题