PHP get final redirect url -


i final redirect url this: http://thatsthem.com/searching?ff=true&q0=rob+stott redirects this: http://thatsthem.com/search/rob-stott/325712f7

i tried answers other stackoverflow answers works other websites not above link. please help.

in case of particular site, redirection done through javascript window.location.replace() you'll need in body of response:

$c = curl_init(); curl_setopt($c, curlopt_returntransfer, true); curl_setopt($c, curlopt_followlocation, true); curl_setopt($c, curlopt_url, "http://thatsthem.com/searching?ff=true&q0=rob+stott"); $html = curl_exec($c); $redirection_url = preg_match("/window\.location\.replace\('(.*?)'\)/", $html, $m) ? $m[1] : null; echo $redirection_url; // http://thatsthem.com/search/rob-stott/325712f7 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -