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"); ?> 

enable cors


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -