doulu3399 2017-02-28 12:39
浏览 138

Wordpress为/ wp-content / themes中的所有文件设置了Access-Control-Allow-Origin

I'm having a lot of problems with CORS errors. So I want to set header("Access-Control-Allow-Origin: *") for everything in my WordPress wp-content/themes directory.

I tried to add it to the .htaccess in /var/www/html but this isn't working in /wp-content

Anyone has an idea on how to do this in a WordPress install?

EDIT: It's a self-hosted ubuntu 14.04 server. And the problem arises with static files, so I cannot add the access control to the header function.

EDIT2:

I think I didn't explain the situation correct.

I have a page on my Wordpress site get10things.com this site uses scripts which loads resources from the same domain. However I want to show parts of this site in iframes on other domains and in our Android and iOS app. Therefor I need to enable "Access-Control-Allow-Origin: *" on all resources which are loaded in the scripts which are used on get10things.com.

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 chaquopy python 安卓
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 CSS实现渐隐虚线框
    • ¥15 有没有帮写代码做实验仿真的
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥30 vmware exsi重置后登不上
    • ¥15 易盾点选的cb参数怎么解啊
    • ¥15 MATLAB运行显示错误,如何解决?
    • ¥15 c++头文件不能识别CDialog
    • ¥15 Excel发现不可读取的内容