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 😭
Tried:
- Modifying Apache Configuration
- Modifying Method of Referencing Image
Expected:
- Image to Load
- No Related Console Errors