Jump to content

Retrieve Redirect url with Curl


Marcoteu

Recommended Posts

Hello all, :D

 

Can somebody help me how to retrieve a redirect Url with Php and Curl??

 

I've got some pseudo code here and this interesting link on:

http://w-shadow.com/blog/2008/07/05/how-to-get-redirect-url-in-php/

 

3 redirected (301) Urls go to one site

 

www.url-1----> www.mysite.com
www.url-2----> www.mysite.com
www.url1-3----> www.mysite.com

On www.mysite.com a Php script what retrieves the redirect Url:
(www.url-1, www.url-2 or www.url-3) 
and put it in a $string.

If $string = "www.url-1"  
echo "<style type="text/css"> #header { background: url(images/url1.gif) no-repeat top left; }</style>"

else if $string = "www.url-2"  
echo "<style type="text/css"> #header { background: url(images/url2.gif) no-repeat top left; }</style>"

else if $string = "www.url-3"  
echo "<style type="text/css"> #header { background: url(images/url2.gif) no-repeat top left; }</style>"

 

Sorry for these pseudo code scribblings but I hope that it makes the idea a little bit clear!  :-\

 

 

Regards,

 

Marco

Link to comment
https://forums.phpfreaks.com/topic/244441-retrieve-redirect-url-with-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.