Chuck Anderson
2009-04-02 20:23:38 UTC
I am getting more and more requests for my sites favicon.ico, but in
subdirectories (The user agent is always Google toolbar -
thankyouverymuch).
I searched and found this redirect solution for htaccess:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/favicon\.ico [NC]
RewriteCond %{REQUEST_URI} favicon\.ico [NC]
RewriteRule (.*) http://example.com/favicon.ico [R=301,L]
# The first condition bypasses valid requests for favicon.ico in the root
I put that in my root .htaccess file, but when I tested it with:
http://example.com/subdirectory/favicon.ico
I still got a 404 error.
When I put it in the subdirectory's htacces it worked.
Shouldn't that work out of the root directory?
subdirectories (The user agent is always Google toolbar -
thankyouverymuch).
I searched and found this redirect solution for htaccess:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/favicon\.ico [NC]
RewriteCond %{REQUEST_URI} favicon\.ico [NC]
RewriteRule (.*) http://example.com/favicon.ico [R=301,L]
# The first condition bypasses valid requests for favicon.ico in the root
I put that in my root .htaccess file, but when I tested it with:
http://example.com/subdirectory/favicon.ico
I still got a 404 error.
When I put it in the subdirectory's htacces it worked.
Shouldn't that work out of the root directory?
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Turn Off, Tune Out, Drop In
*****************************
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Turn Off, Tune Out, Drop In
*****************************