I need to allow Access-Control-Allow-Origin from the following domains:
http://localhost:8080
app://MyApp
This is my current .htaccess
conditions that I need set for both of the above domains:
Header Set Access-Control-Allow-Origin "http://localhost:8080"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Authorization, Accept"
Header Set Access-Control-Expose-Headers "Content-Disposition"
I already read a lot of solutions in SO on this that says to have the server read the Origin header from the client, compare it to the list of domains and then add the values if it matches. However, I am still unable to figure out how will I set my .htaccess
file so it includes:
2 different domains that uses different scheme
Also include
Access-Control-Allow-Methods
,Access-Control-Allow-Headers
andAccess-Control-Expose-Headers
with it.I don't want to use
*
unless that is the only option.
Can someone help me rewrite my above .htaccess
condition to include the 2 domains please.