Page 1 of 1

http rewrite for favicon

Posted: Sun May 23, 2010 4:03 pm
by markosjal
Hello,

I have a server up and running with a domain and a subdomain. Depending on how one goes in , it loads a different identity. Now all I need to do is to load a favicobn bases on whether5 they are looking for abc.mydomain.com/favicon.ico

WHereas if they go to mydomain.com or www.mydomain.com, the default favicon.ico would be loaded

I think I need
RewriteCond
but am not sure how to do this .

I think the http rewrite will look at the (sub) domain, correct?

I was going to do this in php but this seems to make more sense , does it not?

thanks for any help in advance

Re: http rewrite for favicon

Posted: Mon May 24, 2010 2:11 pm
by tr0gd0rr
You probably want to use HTML to include different favicons. Putting the following HTML in the <head> will load favicon.ico from any location you wish.

Code: Select all

<link rel="SHORTCUT ICON" href="/abc/favicon.ico">

Re: http rewrite for favicon

Posted: Tue Jun 01, 2010 3:27 pm
by markosjal
Unfortunately this will mean that I must use different <head> sections thereby using PHP as I said, the mod rewrite seemed to make more sense than turning the headers themselves into variables called by (sub)domain

to clarify when a person is at abc.mydomain I want them to see one favicon, and when at mydomain.com I want them to see a different one

The example you showed is the basic favicon code.

I need a mod rewite based on the (sub)domain the visitor is at.