Cross-Origin Resource Sharing (CORS) (Ajax Cross Domain issue)

PHP:

.htaccess

Enable header module on Apache:

IIS:

Image 4

Reference:

  1. http://blog.toright.com/posts/3205/%E5%AF%A6%E4%BD%9C-cross-origin-resource-sharing-cros-%E8%A7%A3%E6%B1%BA-ajax-%E7%99%BC%E9%80%81%E8%B7%A8%E7%B6%B2%E5%9F%9F%E5%AD%98%E5%8F%96-request.html
  2. http://stackoverflow.com/questions/10640596/header-set-access-control-allow-origin-in-htaccess-doesnt-work
  3. http://stackoverflow.com/questions/869092/how-to-enable-mod-rewrite-for-apache-2-2