I have been coding in HTML for many years and do not understand what is happening.
Please take a look at the following test web page: http://www.snookerlegends.co.uk/imgtest2.html
The page contains two identical images (with slightly different names), each inside a table border. The top one does not display while the lower one does.
The top image is called FP_ad1.jpg and the lower one is called FPad1.jpg (no underscore)
If you check the page source and click the link to FP_ad1.jpg you will see that it does exist on the server so why does it not appear in the page?
The Doc type is HTML 5 but I have tried it with many different Doc types and always the same result.
Even stranger is that if I add any other character after the 1 the picture then does display so FP_ad10.jpg will display
However if I remove the FP and underscore completely leaving ad1.jpg that does not display while ad10.jpg does.
I am completely baffled by this behaviour, I have tried it in different browsers always with the same result. What am I missing?
...Please note the image is an ad for a snooker book. It is not my book nor am I trying to promote it in any way. It just happens to be the image that this behaviour first occurred with...
They both display for me.
They both display for me too.
For me three.
Do you use any kind of content blocker, to avoid ads or for some other filtering?
That is strange. I have an ad blocker in Chrome but it wouldn't know that this image was an add and why would it still display the second one just because I change the name slightly. I have also tested in IE and Firefox with same missing image at the top.
I do use Kaspersky Internet Security so I suppose it is possible that it may be blocking the image but why does changing just one character in the file name or removing the underscore then render it visible. The code for both images is exactly the same otherwise.
Just tried it with Kaspersky protection paused but the image still fails to appear!
Incidentally I have tried this on a local server as well as on the web but the result is still the same.
I tested using Firefox v66 and current versions of IE11 and MS Edge. Both images were shown in all 3 browsers. You do have many validation errors for an HTML 5 document but I don't think that would affect it too much.
When I saved the file at http://www.snookerlegends.co.uk/images/book18/FP_ad1.jpg its size was just 93 bytes. It couldn't be opened by my image editor, but when tried a text editor the following content was shown:
Oh, I didn't think about the file size you got the first time. So that file became broken in the download attempt and an error message, HTML and all, was somehow injected to it. How on earth can that happen?
Nah...
Why would the 403 be sent in the first place?
Maybe something on the server is configured incorrectly? Say, an anti-leech directive in a .htaccess file? I guess it could be anything.
That targets the OP's browser? Sounds far-fetched to me.
Now I got a 403/Forbidden response even from the HTML page http://www.snookerlegends.co.uk/imgtest2.html
When I changed IP (Tor circuit) the page suddenly worked, then I changed IP again and got another 403. Maybe the site uses an IP blacklist? Lots of sites do block Tor exit node IPs due to abuse.
The rule, if there is one, must also target a certain file naming pattern. It's just the one image the OP doesn't see.
Maybe the purpose is to prevent bots from downloading ads? "_ad" does sound advertizing related. OTOH "imgtest2.html" doesn't, and it still returns a 403 for me. So did the site's home page, BTW.
Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)