Litespeed enable Access-Control-Allow-Origin

Posted by Joe Coder Guy on Server Fault See other posts from Server Fault or by Joe Coder Guy
Published on 2012-11-07T03:03:20Z Indexed on 2012/11/07 5:02 UTC
Read the original article Hit count: 1161

Seriously, I can't find a single page discussing this for litespeed.

Using this format in the htaccess "Header set Access-Control-Allow-Origin http://aSite.com" (and https) sends the setting in the header, but I still get the "XMLHttpRequest cannot load https://aSite.com/aFile.php. Origin aSite.com is not allowed by Access-Control-Allow-Origin" error.

Is the server still blocking it even though I've sent the proper headers?

I read elsewhere that it helps to add these terms

Access-Control-Allow-Headers X-Requested-With
Access-Control-Allow-Methods OPTIONS, GET, POST
Access-Control-Allow-Headers Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control

but I don't see these in my headers.

Using these, my PHP files aren't even reached (because they register no errors or anything), so it looks like it comes from the server only, but what do I know.

Thanks in advance!

© Server Fault or respective owner

Related posts about .htaccess

Related posts about access-control