0

I want to add the below snippet to my wordpress installation.

<?php header("Access-Control-Allow-Origin: *");?>

I don't want to add it in every template header as there are many of them and I have 60 networks with 2-3 sites in each network. In what file should I add this snippet so that it has effect across the entire wordpress installation?

1
  • Any update on this?
    – atwellpub
    Commented May 28, 2014 at 22:58

1 Answer 1

3

I would prefer to do this at web server level.

If you are on NGINX server, you can use in your site conf file:

add_header Access-Control-Allow-Origin *;

If you are on Apache server, you can use in your .htaccess:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.