Check this weird thing out!
Fire-up your Wamp/Xampp and try this code:
Code: Select all
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://ebay.com");
curl_setopt($ch, CURLOPT_HEADER, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
$result = preg_replace("#(<\s*a\s+[^>]*href\s*=\s*[\"'])(?!http)([^\"'>]+)([\"'>]+)#",'$1http://mydomain.com/$2$3', $result);
echo $result
?>
HTTP/1.1 301 Moved Permanently Location: http://www.ebay.com/
What does that mean ? On my Chrome, I don't see ebay.com showing any likewise mssg. Nor, am I getting redirected to any other page.
I found the code here:
https://stackoverflow.com/questions/105 ... urled-html
It is supposed to replace all relative links to absolute links.
Enjoy!