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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.