Why won't this apple work?

I have the following code on my website:

<link rel="apple-touch-icon" href="http://website.com/images/apple-touch-icon.png" /> 

When I browse the source in Firefox and click on the href attribute, an icon is displayed (so this is not a 404 error).

When the code is added to a page like http://website.com/mobile/index.php or http://website.com/mobile/page.php and the page is added to the iPhone’s desktop, the icon works fine, but when the URL The page address is similar to http://website.com/page or http://website.com/index , the icon does not work. Does not appear.

There are no errors in the "website debugging console" presented in Safari settings, and I tried to clear the cache and cookies.

I also use the website of the <base href="http://website.com/mobile/" /> , which is displayed on both http://website.com/mobile/index.php and http://website.com/index . But I don’t see how this will affect this, since the apple-touch icon uses the full URL.

+4
source share
2 answers

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 .

+3
source

This will only work from an HTTP or HTTPS site with a valid and valid security certificate .

If there is a certificate error, iOS will not load the image. Temporary certificate trust in Safari for the page will not trust the certificate for the desktop shortcut. If you use a self-signed certificate, you must add an untrusted root certificate as a trusted certificate at the OS level.

  • On your iOS device, go to the page that has a link to the .crt file.
  • Click the link
  • Approve / install through all confirmation screens
+15
source

All Articles