How do I redirect all requests for favicon.ico in root directory or any subdirectory to /images/favicon.ico
the ^ in front is very important
Marcos Placona
2010-03-09 10:20:31
This is giving me an internal server error.Is it beacause (.*)favicon.ico also matches /images/favicon.ico so it becomes a loop
Tim
2010-03-09 11:06:36
Checked error log and it states "Request exceeded the limit of 10 internal redirects due to probable configuration error" so looks like it is indeed redirecting to itself. How do I get around that?
Tim
2010-03-09 15:35:21
Right I skipped [L] flag. Try as per Gumbo's reply.
Sejanus
2010-03-10 04:41:09
I think I need to use this with a RewriteCond to say if request URI not /images/favicon.ico not sure the correct syntax though
Tim
2010-03-11 12:29:13
A:
This quick rewrite should do the trick:
RewriteRule ^(.*)favicon.ico /images/favicon.ico
Marcos Placona
2010-03-09 10:19:03
+3
A:
Try this rule:
RewriteEngine on
RewriteRule ^favicon\.ico$ /images/favicon.ico [L]
Edit And for favicon.ico with arbitrary path segment depth:
RewriteCond $0 !=images/favicon.ico
RewriteRule ^([^/]+/)*favicon\.ico$ /images/favicon.ico [L]
Gumbo
2010-03-09 17:13:05
This works for /favicon.ico but not for /folder/favicon.icoSome browsers are requesting favicon.ico in local folder even though it's specified as /images/favicon.ico so I wanted to redirect the currently failing requests to the correct location
Tim
2010-03-11 12:26:50