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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -