Forum Moderators: coopster

Message Too Old, No Replies

Capturing redirect URLs and final landing URL using snoopy or cURL

capturing all redirect urls while reading a page

         

webdev81

2:28 pm on Aug 17, 2007 (gmt 0)

10+ Year Member



Hi,

I'm trying to capture redirect urls and the final landing url when I read a page through snoopy or cURL. So for example if i read http://www.example.com (1) which redirects to http*://www.example.com (2) and which inturn redirects to http*://www.example.com (3), I wana be able to capture all the URLs in the middle and the final landing url.

Is that even possible? Any help/guidance would be much appreciated.

Thanks

[edited by: dreamcatcher at 2:40 pm (utc) on Aug. 17, 2007]
[edit reason] Use example.com, thanks. [/edit]

d40sithui

5:28 pm on Aug 17, 2007 (gmt 0)

10+ Year Member



something like this?

www.example.com
<?
$page[0] = "example.com";
$_SESSION['page'] = $page;
?>

www.example2.com
<?
$page = $_SESSION['page']; //gets session array
$page[1] = "example2.com"; //adds another element
$_SESSION['page'] = $page; //updates session
?>

www.example3.com
<?
$page = $_SESSION['page']; //gets session array
$page[2] = "example3.com"; //adds another element
$_SESSION['page'] = $page; //updates session
?>

...actualy you may need to find the lenght of the $page array before adding new elements to it...not sure though, this may work.

webdev81

9:56 am on Aug 21, 2007 (gmt 0)

10+ Year Member



Hey,

I know I can save the URLs in the session but the problem here is to capture them. When I read a URL or a page through cURL and it redirects automatically to a different URL, how do i capture that new url.

Thanks