Hello ALL!

I've already set up two domains under the same tree and they are working fine, but I'd like to use different favicons, is it possible?

[]s

Spectra

Comments

gordon’s picture

Use the link command in your theme and the browsers will pick that up instead of the default icon.

try this example below.

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

Just change the href to what you want.
--
Gordon Heydon
Heydon Consulting

--
Gordon Heydon

Aran Deltac’s picture

I believe the only way to do this is with mod_rewrite - modify the same rewrite rules that make friendly links work and you should be set. If you need help doing this feel free to ask.

--
http://www.electroniclife.org/

Aran Deltac’s picture

Oh, gordon, duuuuhh.. man, can't believe I forgot about that. Ignore my overly complicated mod_rewrite solution. Granted, gordon's solution probably means you'll be mucking in your theme...

--
http://www.electroniclife.org/

kbahey’s picture

Are you using the exact same theme from the same directory for all the domains? If so, then there is no solution, not even the link solution above.

What you can do is "clone" the theme to another directory. Say you have domain1 and domain2, then under the themes directory, created two new directories, e.g. domain1 and domain2. Then copy the theme you are using (say pushbutton or friendselectric) to each of these directories.

Now, you can put a separate "link" line for each domain, since they have a different theme in a different directory.

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba

ezheidtmann’s picture

... you can pick the favicon href based on $_SERVER['HTTP_HOST']. That probably means you'll need to use a phptemplate-based theme.

Aran Deltac’s picture

Actually, the solution I first presented would still work in the case of useing the same theme on all sites. Using mod_rewrite you could serve specific favicons for certain domains.

--
http://www.electroniclife.org/

jweiss’s picture

Aran, could you give an example of the mod_rewrite statement(s) needed?

NewZeal’s picture

This is not correct.

If you put a link in your theme page.tpl.php with a variable in it that picks up the current site then that does the trick.

eg:
print "<link rel='shortcut icon' href='". ROOT_DIR ."/".SITE."/pix/favicon.ico' >";

adrian’s picture

(for CVS HEAD).

It picks up favicon.ico files in the theme directory.

--
The future is so Bryght, I have to wear shades.

kbahey’s picture

Adrian, I am not sure if this is a general theme thing, or phptemplate specific. But I will ask anyway, since you brought it up.

Can the favico be configurable? Like the logo?

I mean that under /admin/settings/theme there would be a text field for entering the favico, just like the logo is now.

Then the template would have a line with "link" as suggested above.

This allows someone who runs multiple sites to have a subdirectory for each site, with the logo, favico, ..etc.

--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba