Tom Tom - 1 year ago 65
HTML Question

Why won't this apple-touch-icon work?

I have the following code in my website:

<link rel="apple-touch-icon" href="" />

When I view the source in Firefox and click the href attribute the icon shows (so its not a 404 error).

When the code is added to a page like
and the page is added to an iPhone homescreen the icon works fine, but when the page url is like
the icon doesn't show up.

No errors appear in the "website debug console" provided in Safari options and I've tried clearing the cache and cookies.

Also I use the tag
<base href="" />
website, which shows up on both
. But i can't see how that would effect it since the apple-touch-icon uses a full url.

Answer Source

Try using a relative URL:

<link rel="apple-touch-icon" href="/images/apple-touch-icon.png" />

It should go to your base directory and find the icon in /images.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download