- PHP後臺配置
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
//主要爲跨域CORS配置的兩大基本信息,Origin和headers
- 配置Apache web服務器跨域(httpd.conf中)
源代碼
<Directory />
AllowOverride none
Require all denied
</Directory>
修改後
<Directory />
Options FollowSymLinks
AllowOverride none
Order deny,allow
Allow from all
</Directory>