Eureka Moment Wiki

One eureka moment at the time

User Tools

Site Tools


development:js:cross-origin_request

Cross-Origin Request Blocked

For Microsoft IIS7, merge this into the web.config file at the root of your application or site:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
 <system.webServer>
   <httpProtocol>
     <customHeaders>
       <add name="Access-Control-Allow-Origin" value="*" />
     </customHeaders>
   </httpProtocol>
 </system.webServer>
</configuration>

For Apache

Via .htaccess
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
</IfModule>

Or set correct headers into the response header of the requested file, you will allow everyone to access the ressources:

Access-Control-Allow-Origin : *
 
or
 
Access-Control-Allow-Origin : http://www.my-domain.com
development/js/cross-origin_request.txt · Last modified: 2018/09/18 09:41 by tplecko