When recursively expanding an URL, is it safe to rely on the URL result using curl_getinfo($ch, CURLINFO_EFFECTIVE_URL) other than the Location header (301/302 redirection)?
I found that the location URL might be relative, but the CURLINFO_EFFECTIVE_URL is always absolute. Which one is better? I'm doing recursive expanding for a URL.
Thanks!
Using
CURLINFO_EFFECTIVE_URLsaves you some work as in the end you need to have FQDN anyway:https://www.rfc-editor.org/rfc/rfc7231