PHP Trace Redirect -
I have more than 10,000 URL's database, though each one redirects to another URL. How can I request a URL and ultimately (possibly) find out in the path of several redirects?
You can do the following:
$ c = curl_init ('Http: //original.url'); Curl_setopt (CURLOPT_FOLLOWLOCATION, true); Curl_exec ($ c); // Error checking in here - see curl_error () $ newUrl = curl_getinfo ($ c, CURLINFO_EFFECTIVE_URL); Curl_close ($ c);
Comments
Post a Comment