簡體   English   中英

獲取重定向頁面的URL-PHP

[英]Getting the URL of redirected page - PHP

我有一個我要重定向頁面的URL: http : //www.hotukdeals.com/visit? m=1650&q =1542029

我已經嘗試過:

$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

我該如何工作?

謝謝。

在大多數情況下,這應該可行,除非使用Javascript進行重定向。

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM