I am trying to send a post Request from www.websiteA.com
to www.websiteB.com
. I am sending the POST from Javascript with XMLHttpRequest
on A to a python script on B. The python file on B, is called my_save.py
and is located at /var/www/cgi-bin/my_save.py
and so in the directory /var/www/
I added a .htaccess
file that contained this
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
As I saw on this question htaccess Access-Control-Allow-Origin and other places telling me to do this.
But the same error
XMLHttpRequest cannot load http://websiteB.com/cgi-bin/my_save.py. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://websiteA.com' is therefore not allowed access.
How can get rid of this error and make the post to websiteB?
Thanks for the help