I have a file aboutus.html in www.domain1.com
I want to access this file from www.domain2.com
While rewriting, the URL in the address bar should be www.domain2.com/aboutus.html.
<?php
header("Content-type: text/plain");
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "GET /search?q=php HTTP/1.0\r\n";
$out .= "Host: www.google.fi\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
If both domains are *not* hosted on the same server:
- You cannot do this because there is no way to have your web browser location bar show you one address, but fetch a page from another address.
Users browsing this forum: No registered users and 93 guests