简体   繁体   中英

get PHP redirect url

I am working on a application that requires me to get the final URL after redirection. I tried different solutions before posting this question but nothing works.

The initial url to query is Base URL . It uses JS redirection and redirects to Redirect URL

is there a way where I can get the final redirected url from the initial url ?

Use curl_getinfo() with opt parameter CURLINFO_EFFECTIVE_URL

From above linked page:

CURLINFO_EFFECTIVE_URL - Last effective URL 

It is a JS redirect. If you look at the JS code of the first page you'll see how it generate the next URL. You can try to implement the same URL generation and get the final URL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM