There is no callback function that changes headers on-the-fly, as you
would have to wait for the request to be over to do so anyway. I think your
best option is to get the headers for each handle you have (using
CURLOPT_NOBODY), checking to see if the redirect URL has the HTML anchor,
and then doing the full requests to the redir-urls on a second pass through,
with the corrections.
Of course, whether this makes sense depends on a) How often a URL with this
problem turns up, and b) How critical time taken is in your application. If
this solution is no good, I guess your only other option is to rebuild cURL
on your server and patch the backend yourself. (assuming you know some C).
On Mon, Jul 6, 2009 at 06:25, Martin Konradi <martin_at_konradi.de> wrote:
> Dear List,
> I'm getting 404 errors if I use CURLOPT_FOLLOWLOCATION and the
> "anchor-part" #xyz remains in the url as described in:
> Is there a workaround for php like a callback-funktion to rewrite the
> header-redirect when using curl_multi_exec() ?
> Thanks a lot!
Received on 2009-07-06