'How to prevent browser from changing http url to https?

I am trying to load images into my website using HTTP URL but the problem right now is that when the website URL is being read the browser will come out with this Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure element '<URL>'. This request was automatically upgraded to HTTPS, For more information see <URL> and automatically change the HTTP URL to an HTTPS URL which leads to nothing but protocol error.

How do I prevent this from happening? I have tried adding this but it giving me this error instead:

The key "upgrade-insecure-requests" is not recognized and ignored.



Solution 1:[1]

You need to replace URL HTTP:// to HTTPS:// only that's way to resolve, you can change base URL of image – Yasin Sunni Dec 28, 2021 at 6:21 What if we´ve got a massive file from source that it keeps the image only http not https, like this, those images are only visible if you type http, not https (it breaks)... I cannot ask the source to chage their storing files just cause I cannot transform it into a visible image at the app or website. There must eb a way to solve this without having to ask the source to change their storing images address...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cristian Villaverde