Reputation: 5532
I have an image on imgur. this image is displaying on any website except on localhost.
What might be the problem?
<img class="cover" src="https://i.sstatic.net/wqYLI.jpg" alt="">
Error: GET https://i.sstatic.net/wqYLI.jpg 403 (Forbidden)
Upvotes: 6
Views: 3884
Reputation: 3
This isn't really a solution to your live-server issue however:
Using Visual Studio Code editor, having tried following extentions:
So if all you are interested in is figuring out how it looks and making adjustments I suggest just using preview on web server extentions.
Upvotes: 0
Reputation: 6882
They block 127.0.0.1
origin for some reason. To solve this, I added a new line to my /etc/hosts
file:
127.0.0.1 vnbrs.localhost
And accessing vnbrs.localhost:4001
(the port I was running my web server), it worked!
Please note that you have to use the .localhost
TLD.
Upvotes: 0
Reputation: 5532
Strangely, imgur is restricting to access the image directly from localhost. However if you access your localhost using IP address, you are able to see the image.
Example:
http://localhost/site (not allowed)
http://192.168.0.2/site (allowed)
This is not only for this image, but also any imgur image.
Upvotes: 6