How can I fetch the content of a post of my wordpress domain from an other domain?


I have my wordpress website, let’s say, and an other domain, let’s call it

I would like to allow GET queries coming from the javascript client code of to

Something like:

File main.js hosted under

$.get("", function(...) {... } )

I looked up different information on Google and it seems that I have to edit the .htaccess on to enable

I looked at:

But now I am not sure what to set up.

The Header set Access-Control-Allow-Origin "*" is scaring me. I am worried any website will be able to fetch data from my website instead of only

I am also confused between somewebsite talking about HTTP header vs setting up .htaccess vs setting files name vs subdomain.

I just want to open some get request. I don’t care about the specific files. I want to be able to receive the HTML of my page on this other domain.

Wonay 5 months 0 Answers 63 views 0

Leave an answer