|PHP Developers Network
|ERROR: HTTP/1.1 301 Moved Permanently Location
|Page 1 of 1|
|Author:||UniqueIdeaMan [ Wed May 24, 2017 5:45 pm ]|
|Post subject:||ERROR: HTTP/1.1 301 Moved Permanently Location|
Check this weird thing out!
Fire-up your Wamp/Xampp and try this code:
$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);
$result = preg_replace("#(<\s*a\s+[^>]*href\s*=\s*[\"'])(?!http)([^\"'>]+)([\"'>]+)#",'$1http://mydomain.com/$2$3', $result);
Now, instead of ebay.com loading you will see an error mssg like so:
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.
|Page 1 of 1||All times are UTC - 5 hours|
|Powered by phpBB® Forum Software © phpBB Group