Forum Moderators: phranque

Message Too Old, No Replies

Multi favicon

         

Readie

8:42 am on Dec 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am seperating two websites at a code level, rather than at a file level using the following PhP If statement:

if (preg_match('/^(www\.)?example1\.co\.uk\.?(:[0-9]+)?$/',$_SERVER['HTTP_HOST']))
{
$variables = 'stuff';
}
else if (preg_match('/^(www\.)?example2\.co\.uk\.?(:[0-9]+)?$/',$_SERVER['HTTP_HOST']))
{
$variables = 'other stuff';
}

And I was wondering if there was any method for defining a seperate favicon library for each URL?

Regards,

Readie

londrum

11:28 am on Dec 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



probably not the ideal way of doing it, but this would work. just name them something other than favicon.ico, and point to the relevant file in the head with a
<link rel="shortcut icon">
tag.

phranque

10:44 pm on Dec 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you could use mod_rewrite to send all requests for favicon.ico to a php script and then use the php script to send the proper response depending on the requested HTTP_HOST.
in any case you will not be able to use a single .ico file to provide both sets of icons.

Readie

12:27 am on Dec 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey, I appreciate the ideas, however I am no longer intending to do this as I cannot get the icons (in particular the 16x16 size) to look as I want them to, despite a very long time of frustrating Photoshopping.

I am intrigued by the idea from phranque to use mod_rewrite however, and will look into it at some point in the near future simply for experimental and self-learning purposes.

Will post here after.

Regards,

Readie