Custom codeiginiter app cors error

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Application configuration

bnsupport ID: 52fdcee9-1dcd-6015-44d2-2acf6eac0d9d

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues

bndiagnostic failure reason: The suggested guides are not related with my issue

I have created a custom app and running application. It’s working fine but when I try using API from this application to our Ionic APP. It gives below error.

Access to XMLHttpRequest at ‘’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The ‘Access-Control-Allow-Origin’ header contains multiple values ‘*, *’, but only one is allowed.

I am a beginner to AWS and binami so, unable to find how to solve this that ionic app can access it.


@fdepaz Have you any idea about it. Please help me.


Hi @rakeshkumar125,

Thank you for using our solution. That’s a specific question about the Apache and its configuration so we suggest you ask in an Apache-specific forum or review its documentation to get more information about it. (You probably need to change the value of that parameter to *, not *, *)

However, we will also keep this ticket open in this forum in case any Bitnami user configured the application they way you want to.


@jota Thanks for your reply I was google for it and found one more link that was related to our problem which is below.

I have added below code in file (/opt/bitnami/apache/htdocs/my-app/.htaccess).

    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Headers "Content-Type, Authorization"
    Header always set Access-Control-Allow-Methods "GET"
    Header always set Access-Control-Expose-Headers "Content-Security-Policy, Location"
    Header always set Access-Control-Max-Age "600"

    RewriteEngine On
    RewriteRule ^(.*)$ $1 [R=200,L]

Then error is removed & API start working.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.