Overriding favicon autodetection

Started by therealkickers, December 04, 2011, 05:36:32 PM

Previous topic - Next topic

therealkickers

Hello again!

I have a question. (Say, really? :-) )

We have been struggeling to change our favicon for quite some time now.
Behold: We have checked the forum search  8)

The problem we can't seem to solve is:

Our forum is located quite some folder levels beyond the surface of our webspace.
What is placed on the absolute root of our server is a complete independant website with its very own favicon.
*Our* *website* is located one folder deeper, e.g. "htp:/www.domain.com/folder/"
Our forum is located one further folder deeper, e.g. "htp://www.domain.com/folder/forum"

Now we have absolutely no problem to assign our favicon to our *website*. But we keep failing to assign it tou our forum. The forum automatically uses the one from the independant website on the root of our server. Luckily both sites deal with the same subject, but still we need our very own favicon.

I have copied our favicon in virtually every existing folder of our webspace.
Our favicon is 16*16 and works fine on our webspace, all direct links to the icon are ok.
I have added dozens of favicon hrefs into the head of index.template (each different ones found here, via google, wikipedia and other search results..
I have cleared cache at least  372 times.

As the old favicon refuses to give way nevertheless, I must either have made a mistake somewhere or I'm missing an essential point.

The "wrong" favicon the forum still uses can be seen here: www.mono-inc.com
The favicon it should use instead can be seen here: www.monofans.de/fanclub
The forum can be found here: www.monofans.de/fanclub/forum

Any idea what we're doing wrong?

Thanks a lot!
Christoph

MrPhil

If no other instructions are given, a browser will request (and display) /favicon.ico. If you want your favicon from a different place (your case), or a different name, or a different format; you need to add a <link rel="SHORTCUT ICON" href="http://www.mydomain.com/myicon.ico"/> tag in every page header. Search the SMF community for that and you'll find plenty of discussion.

therealkickers

That's exactly what I did - search the forum and enter this tag into the header. Still it won't change, that's why I came here.

Well, I didn't put it in *every* header. I have no idea how many dozens of files that might be.
Guess I'll have to ask the owner of the root website to change it there as this is much easier...

Wel'll see.

Thank you!
Christoph

Illori

the only file you need to edit for this would be the index.template.php as it has the header for the forum, otherwise you could cause problems putting this code in other files.

therealkickers

As I said - I already entered that code in different headers, also into the index.template.php because that was mentioned quite a few times in the search results. Nothing changed. (I deleted the entry each time it didn't work not to mess everything up).

I'll restore the entry in this file just in case this could help finding the reason why it won't show.

OT: Funny that many moderators and admins have got cats as avatars. Is that some kind of system? Like it!

Illori

what "header" are you adding it to exactly? what code and where are you putting it?

therealkickers

#6
I have now re-added the tag

<link rel="SHORTCUT ICON" href="http://www.mydomain.com/myicon.ico"/>

index.template.php right under the very first "head" entry of my selected template

www.monofans.de/fanclub/forum

ETA: Now the favicon is completely gone. Whaa!

Illori

but WHERE in that file are you adding that?

therealkickers

Not sure what you mean. It's supposed to be located in its header, and that's where I put it.

Illori

i would suggest you put echo ' before it, but i cant tell much as i cant see all the code. it would help if you posted the code block in code tags or attached your file.

therealkickers

I have attached the PHP file 1:1
At the moment I'm testing with "echo".

Thanks for looking into it!



Illori

it looks like it should work the way you have it coded without the echo '

therealkickers

Thing is - it doesn't   :(
At this time every reload of the forum the old (wrong) favicon keeps on appearing and disappearing again...
Edit: This means at the first load the wrong icon is up, next reload no icon is there at all (IE icon). At the moment it won't come back at all.

Guess I'll have to stick with the old one and no code in the PHP file. This way at least the old Icon was there permanentely.

MrPhil

Your problem is that you failed to use proper quotation marks " around the href= URL. Never, never, never use Word or other Microsoft word processing programs to edit a code file. It puts in "smart quotes" which are not correct. Use Notepad, or even better, Notepad++ or ViM to edit PHP.

therealkickers

Bullseye! And all that with your 4000th posting  ;D

Now I didn't expect *that*.

Honestly I have not used Word in any way, but the quotation marks in that line really were different and as soon as I changed them using Wordpad MFC the favicon appeared.

Standing sill at learning is always a step back - very appropriate in this case :-)

Thank you very much!

Christoph

Advertisement: