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 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试