php - Access-Control-Allow-Origin that must work for localhost and another domain -
i have put in .htaccess
file, works on localhost:
<ifmodule mod_headers.c> setenvif origin "http(s)?://(www\.)?(localhost|mydomain.com)$" accesscontrolalloworigin=$0$1 header add access-control-allow-origin %{accesscontrolalloworigin}e env=accesscontrolalloworigin </ifmodule>
i have both on localhost , on server mod_headers enabled.
i following error:
origin http://mydomain.com not allowed access-control-allow-origin, response ajax
any help?
on server, issue
<?php //header("access-control-allow-origin: *"); header("access-control-allow-origin: mydomain.com"); ?>
Comments
Post a Comment