title: origin 'http://localhost' has been blocked by CORS policies error in codeigniter only due to the path in config page :- Not duplicate question
body: <p>I am getting an error like:</p>
  <pre><code>origin 'http://localhost' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. 
  </code></pre>
  <p>This error occurs only when the design is integrated in codeigniter.</p>
  <p>Please note who all added this question as duplicate.
  my question is not a duplicate question of <a href="https://stackoverflow.com/questions/20035101/why-does-my-javascript-code-receive-a-no-access-control-allow-origin-header-i">this</a> .
  My solution is added as the comment.
  Since, some geeks who think that, its a duplicate question, and reviewd it like so, I am not able to answer my own question. Once I get the privilage to add so, I will move the comment to answer.</p>
  <p>Thankyou</p>