I don't know much about working with .htaccess files. I've tried researching. So, maybe someone could help me out on here. I want to allow https and http at the same time. Let me explain.
http is working but a website on HTTPS is giving me a error in the console
XMLHttpRequest cannot load https://domain1.com/data.json. The 'Access-Control-Allow-Origin' header has a value 'https://www.domain1.coms' that is not equal to the supplied origin. Origin 'https://www.domain1.com' is therefore not allowed access.
If I change the "http" to "https" it works for the https website but then the http website doesn't work. How do I allow both at the same time?
I hope that made any sense to you guys! Thank you for any help!
Here is my code:
<IfModule mod_headers.c>
SetEnvIf Origin "http(s)?://(www\.)?(domain.com|domain2.com|domain3.com|domain4.com|domain5.com)$" AccessControlAllowOrigin=$0$1
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
Header set Access-Control-Allow-Credentials true
</IfModule>