Use curl to find redirect url of

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi.  I'm trying to use cURL to output the redirect of the site
which redirects to
But it does not work... What am I doing wrong?
I want to know what the redirect url is and then output it on a page.

Here is my code.

// create a new CURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, " ");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

echo "<pre>";
echo "</pre>";

// grab URL and pass it to the browser

// close CURL resource, and free up system resources

Dan Savage

Re: Use curl to find redirect url of

Quoted text here. Click to load it

 If you dump out the contents of the original URL, you can see it uses
Javascript to do the redirection.

 Visit the page with Javascript disabled and you get locked out of the site.
cURL won't be running Javascript either.

< Space: disk usage analysis tool

Site Timeline