[wp-hackers] wp_remote_request not telling me the 301'd URL

Scott Kingsley Clark scott at skcdev.com
Mon Feb 28 09:37:53 UTC 2011

So with a site setup using alternative permalink structures (rather than the 
default ?p=X), when you go to a URL with that ?p=X on it, it will redirect 
you to the correct URL. What I'm seeing though is while my browser may do 
this, and headers checks appear to do this, the wp_remote_request returns a 
200 and the content of the final URL. If I set the $options array to set 
'redirection' to 0, then I get a WP_Error, neither of which tell me the new 
URL. I tried to get the information from wp_remote_request, through the 
'response' / 'headers' keys of the returned array.

Anyone have any tips on how to use wp_remote_request AND get the destination 

-Scott Kingsley Clark

More information about the wp-hackers mailing list