wordpress - get content of url ignoring redirect with php curl -
is possible ignore 301 moved permanently redirect , contents of original webpage. example: have domain1.xxx/post1/ , redirect domain2.xxx/home/ (but i'm sure post1 still prensent in first url) possible content of post1 domain1.xxx?
<?php $url = 'domain1.xxx/post1/'; $ch = curl_init(); curl_setopt($ch, curlopt_url,$url); curl_setopt($ch, curlopt_header,1); curl_setopt($ch, curlopt_nobody,0); curl_setopt($ch, curlopt_returntransfer, 1); //important curl_setopt ($ch, curlopt_followlocation, 0);//important $r = curl_exec($ch); curl_close($ch); echo $r; ?>`
but return me :
"moved permanently
the document has moved here."
is test not hacking have authorization of owner of site test this. site done wordpress.
thnak
Comments
Post a Comment