title: Domain has been blocked from loading by Cross-Origin Resource Sharing policy
body: <p>I have made a <code>codeigniter</code> application. I uploaded it to <code>http://www.domain.com</code>.</p>
  
  <p>But <code>Chrome</code> continuously give the message...</p>
  
  <p><code>Font from origin http://www.domain.com has been blocked from loading by Cross-Origin Resource Sharing policy. Origin 'http://domain.com' is therefore not allowed access</code>.</p>
  
  <p>I set my <code>base_url</code> in <code>config.php</code> as <code>http://www.domain.com</code> but the error still persists.</p>
  
  <p>When I changed the <code>base_url</code> as <code>http://domain.com</code>, it gives error as...</p>
  
  <p><code>Font from origin http://domain.com has been blocked from loading by Cross-Origin Resource Sharing policy. Origin 'http://www.domain.com' is therefore not allowed access</code>.</p>
  
  <p>I've written the below code in my <code>web.config</code>, but no result.</p>
  
  <pre><code>&lt;staticContent&gt;
      &lt;clientCache httpExpires="Sun, 29 Mar 2020 00:00:00 IST" cacheControlMode="UseExpires" /&gt;
      &lt;remove fileExtension=".woff" /&gt; &lt;!-- In case IIS already has this mime type --&gt;
      &lt;mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /&gt;
      &lt;remove fileExtension=".eot" /&gt;
      &lt;mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" /&gt;
  &lt;/staticContent&gt;
  </code></pre>
  
  <p>I have seen <a href="https://stackoverflow.com/questions/22213207/localhost-image-from-origin-null-has-been-blocked-from-loading-by-cross-origi">a</a>, <a href="https://stackoverflow.com/questions/37768518/image-from-origin-file-has-been-blocked-from-loading-by-cross-origin-resour">b</a>, <a href="https://stackoverflow.com/questions/34998629/cross-origin-resource-sharing-policy-blocking-glyphicons-from-bootstrap-in-codei">c</a> these links, but unable to resolve.</p>
  
  <p>What should I do ?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Actually the error comes from the domain name. If I write <code>www.domain.com</code> while my <code>config.php</code> <code>base_url()</code> is <code>http://domain.com</code>, it gives the error. On the other hand, if my If I write <code>domain.com</code> while my <code>config.php</code> <code>base_url()</code> is <code>http://www.domain.com</code>, it also gives the error.</p>