2013-05-04 103 views
0

我有这样的URL到我想要重定向的页面: http://www.hotukdeals.com/visit?m=1650&q=1542029被重定向页面的URL - PHP

我已经尝试过:

$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; 

我得到这个响应,这是相同的URL:

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

我怎样才能使这个工作?

谢谢。

+0

可能重复:[http://stackoverflow.com/questions/3519939/make-curl-follow-redirects](http://stackoverflow.com/questions/3519939/make-curl-follow-redirects ) – bitWorking 2013-05-04 10:51:30

回答

0

这应该在大多数情况下工作,除非使用Javascript进行重定向。

print_r(get_headers('http://www.hotukdeals.com/visit?m=1650&q=1542029'));