user2962698
user2962698

Reputation: 155

<img> not working with the url but when I put the url in browser it works

The following image shows as a broken image but when I put the URL in my browser it works fine. After I access the image through my browser VIA url, the image is cached and the image tag starts to work but once I clear my cache the image is broken again. Can someone help me with this issue?

<img src="http://www.rktteam.vastserve.com/Brawlhalla-660x330.png" style="background-color: initial;">

 I don't think its the HTTPS/HTTP mismatch issue. On the left is a broken image with HTTP URL (it works when you access it in your browser). On the right is another image with HTTP but it works even after I clear my cache.

See the full html here. https://www.rkt-team.com/events/32

Upvotes: 1

Views: 2425

Answers (6)

Bereket Assefa
Bereket Assefa

Reputation: 1

first check in the network tab if the requests to the image are successful. In my case the request to image was blocked due to inappropriate header and I fix i t using this link How to prevent ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep?

Upvotes: 0

user2962698
user2962698

Reputation: 155

I wasn't able to fix this. The problem had to do with http://www.uhostall.com/. However I was able to do a work around. I changed my host to 000webhost and I am no longer getting this problem.

Upvotes: 0

kamilk
kamilk

Reputation: 4049

When the browser requests the image, what the server returns is not an image at all - the MIME type is returned as text/html.

Content Type: text/html

Investigate the server if you want to find out why it's doing it.

Upvotes: 0

James Hamann
James Hamann

Reputation: 862

It could be a problem with your output buffer. Is it built using php? Have you tried ob_clean()?

Upvotes: 0

user6451712
user6451712

Reputation:

Try to remove background-color

Upvotes: -1

MattDiMu
MattDiMu

Reputation: 5003

You link to a site using the https protocol, but the img you've referenced uses the http protocol. Due to security reasons you must not load unsecure (http) content, in an https site.

Change http to https or the other way round.

Upvotes: 3

Related Questions