I'm not sure that I fully understand, but it sounds like you want to create a "man in the middle". So that when I call http://2.2.2.2/retreive.php, it then calls http://1.1.1.1/receive.php
It would
See this example from the user comments on the curl() manual page
<?p
$url="http://anything";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "fieldname=fieldvalue&fieldname=fieldvalue&");
#curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$store = curl_exec ($ch);
$content = curl_exec ($ch); # This returns HTML
curl_close ($ch);
?>
This shows you how to post values to the 1.1.1.1 page. You just have to extract the variables sent to the 2.2.2.2 page and insert them into CURLOPT_POSTFIELDS.
The response to this will be a the html from the 1.1.1.1 page. What you do with tat output is up to you.
if you display it, your user will get a page that looks like the 1.1.1.1 page and is full of links to the 1.1.1.1 page.
You could rewrite this to change all the 1.1.1.1 references to 2.2.2.2 but this is a lot of work and very, very fragile.