Why do I get error 403 while trying to access apple-touch-icon.png over HTTPS but test in browser gives 200?

537 Views Asked by At

I have an apple-touch-icon.png in the root of my website in IIS 8.5, this is in the header:

<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">

In the web.config I give read access to this file:

<add name="AppleTouch" path="apple-touch-icon.png" verb="*" type="System.Web.StaticFileHandler" resourceType="File" requireAccess="Read" preCondition="integratedMode" />

When I test this in all browsers the icon shows up, but when I try to bookmark on an iPad I get the 403 error without a substatus.

Even when I check the favicons on https://realfavicongenerator.net/favicon_checker they work.

UPDATE1: using the "Failed Request Tracing Rules" in IIS I managed to get more info on the error. it shows this warning:

MODULE_SET_RESPONSE_ERROR_STATUS 
ModuleName
IsapiFilterModule 
Notification
AUTHENTICATE_REQUEST 
HttpStatus 403 
HttpReason
Forbidden 
HttpSubStatus 0 

UPDATE2: thanks to more debugging of the IsapiFilterModule I found an issue with the .htaccess file. The apple-touch-icon.png was blocked by HackRepair.com Blacklist 2018 where CFNnetwork was blocked. Removing the RewriteCond for this HTTP_USER_AGENT gave no more 403 errors! The apple-touch-icon now works on iPhone, but not on iPad.

1

There are 1 best solutions below

1
Brando Zhang On

As far as I know, the 403.0 means user doesn't have the permission to access the file.I suggest you could follow below steps to modify the file's perission.

1,Right click the png file and click the property.

2.Click security and add iusr in the permission tab

enter image description here

3.Modify the IUSR permission to allow read and write.