LoginSignup
0

More than 3 years have passed since last update.

よくあるクロスドメインの対応

Last updated at Posted at 2019-07-03

エラーが出た。

Access to XMLHttpRequest at 'http://hogehoge.com' from origin 'http://fugafuga.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

http://fugafuga.comのconfにheaderを追加

<Directory>
    Header set Access-Control-Allow-Origin "http://hogehoge.com"
    Header set Access-Control-Allow-Credentials true
    ...
</Directory>

これだけで対応できた。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0