title: CORS ORIGIN issue with different domains
body: <p>I am using <strong>CodeIgniter</strong> REST API with Angular frontend.</p>
  
  <p>I tried to fetch and post data with REST API, but <strong>CORS</strong> error occurs in console, and I installed chrome CORS extension and enabled to solve the problem.</p>
  
  <p>When I moved files to the remote host, same error occurs again.</p>
  
  <p>Files hosted on a different server than the REST API.</p>
  
  <p>for example:</p>
  
  <pre><code>frontend: http://frontend.com
  RestApi:  http://ipaddress.com
  </code></pre>
  
  <p>I tried to enable the <strong>CORS</strong> in <code>.htaccess</code> and HTTP headers through PHP, to no avail.</p>