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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料