Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1493

Cross-referencing Images Between Website (CORS) Error

$
0
0

I am encountering an error when referencing an image, hosted on one of my websites, from another one.

Problem

  • Image is hosted on https://example1.com
  • Trying to reference image from https://example2.com by placing src="https://exmaple1.com/imaginaryPath/guest.png" in an <img> element.
  • Image doesn't appear. Console returns "Access to image at 'https://example1.com/imaginaryPath/guest.png' from 'EX.AM.PL.E/IP" origin "https://example2.com/" has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource."

.htaccess on https://example1.com/

(yes the root site directory, not a subdirectory.)

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET"

Yes, httpd (Apache) reads the .htaccess per the rules in the .conf

Please help 😭

The console error

Tried:

  • Modifying Apache Configuration
  • Modifying Method of Referencing Image

Expected:

  • Image to Load
  • No Related Console Errors

Viewing all articles
Browse latest Browse all 1493

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>