내 웹 사이트에서 '깨끗한 URL'로 작업하기 위해 사용자 정의 .htaccess 파일을 만들었지 만 이제는 내 favicon이 작동하지 않습니다. 내 재 작성 규칙 때문에 그런 것 같지만 확실하지 않습니다. favicon은 /favicon.ico로 루트에 위치하며 내 사이트의 헤더에서 호출됩니다. 이것은 htaccess로 내가 사용된다Favicon이 .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
?
www.example.com을 example.com으로 전달할 것입니다. 나는 종종 불필요한 접두사가 짜증나는 것을 발견한다. : P –
브라우저에서 favico로 바로 이동할 수 있습니까? 예를 들어 www.example.com/favico.ico 나와 Forbidden으로 돌아온다 : http://www.theroyalinstitute.com/favicon.ico –
@Andrew M : 아니오, 직접 찾아 볼 수는 없습니다. 403 Forbidden too ... 정말 어떻게 해결해야할지 모르겠다. –