WordPress的CORS问题

时间:2019-01-09 14:09:13

标签: php wordpress cors

提交表格(CF7Form)并遇到以下错误后,我试图将用户重定向到Paypal网站:

  

从原点“ https://www.paypal.com/au/cgi-bin/webscr?business=xyz@gmail.com&currency_code=AUD&lc=AU&item_name=aaa&custom=NRJM%20126&cmd=_xclick”对“ http://www.jaf.org.au/wp-json/contact-form-7/v1/contact-forms/3041/feedback”(从“ http://www.jaf.org.au”重定向到XMLHttpRequest的访问已被CORS策略阻止:对预检请求的响应未通过访问控制检查:飞行前请求不允许重定向。

通过添加以下行来尝试各种选项,例如编辑.htaccess文件:

Header set Access-Control-Allow-Origin "*" 

Header add Access-Control-Allow-Credentials "true" 

Header set Access-Control-Allow-Headers "Origin, Accept, Authorization, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers" 

Header set Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
Header set Access-Control-Max-Age "1800" 

对于解决该问题的任何建议将不胜感激

强文本

0 个答案:

没有答案