Ajay Choudhary
Ajay Choudhary

Reputation: 281

Change the url of the ajax call

i am using the curl to fetch the data from the url link and is working fine but the issue is that the response data uses the ajax call but all these ajax call are using my server domain but i need them to use the original path of the ajax call, where the files are located. E.g

/ajax/fetch.php changes to http://original-domain.com/ajax/fetch.php

please tell me the appropriate solution for this problem.

Upvotes: 0

Views: 226

Answers (1)

preinheimer
preinheimer

Reputation: 3722

You need to convert a relative URL to an absolute one, take a look at this: Transfrom relative path into absolute URL using PHP

Something like rel2abs('/ajax/fetch.php', 'http://original-domain.com/ajax');

Upvotes: 2

Related Questions