cancel
Showing results for 
Search instead for 
Did you mean: 
Thomas_Schaefer
Nimbostratus
Nimbostratus

Problem this snippet solves:

A simple iRule that redirects the user to the main favicon file. This could be greatly expanded, but it came in handy for sites that did not have a favicon (in a virtual hosting environment). A more robust implementation would be to check for a 404 and see if the page requested was favicon, then send the file. That way, if the virtual hosted site DOES have their own favicon file, the browser would get that.

How to use this snippet:

Note: I'm not sure a browser will follow a redirect for favicon.ico requests. It might be better to rewrite any requested URI ending in /favicon.ico to exactly /favicon.ico. (Aaron)

Code :

when HTTP_REQUEST  {
#Thomas Schaefer, Better Software Solutions, Inc.
# A crazy simple iRule to redirect any favicon.ico requests to the favicon on your homepage
# This promotes a uniform presentation.
# Note this could be expanded to server the data right from the iRule (think external data class)
if  {[HTTP::path] ends_with "/favicon.ico"}{
HTTP::redirect "http://www.mycompany.com/favicon.ico"
}
}
Version history
Last update:
‎18-Mar-2015 14:49
Updated by:
Contributors