0

I have this URL to which I'm trying to redirected the page: http://www.hotukdeals.com/visit?m=1650&q=1542029

I already tried:

$ch1 = curl_init("http://www.hotukdeals.com/visit?m=1650&q=1542029"); 
    curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, TRUE);
    curl_setopt($ch1, CURLOPT_NOBODY, TRUE);
    curl_exec($ch1);
    $curl_url = curl_getinfo($ch1, CURLINFO_EFFECTIVE_URL);
    echo $curl_url;

I'm getting this response, which is the same URL:

http://www.hotukdeals.com/visit?m=1650&q=1542029

How can I get this to work?

Thank you.

Expedito
  • 7,771
  • 5
  • 30
  • 43
Llamedo
  • 14
  • possible duplicate: [http://stackoverflow.com/questions/3519939/make-curl-follow-redirects](http://stackoverflow.com/questions/3519939/make-curl-follow-redirects) – bitWorking May 04 '13 at 10:51

1 Answers1

0

This should work in most cases, unless the redirect is made with Javascript.

print_r(get_headers('http://www.hotukdeals.com/visit?m=1650&q=1542029'));
The Coding Monk
  • 7,684
  • 12
  • 41
  • 56