Hi all,
Is there any way to grab the final url after you go to an url and are redirected? For example, you have the source url http://www.source and if you go to that url, you will be redirected to http://www.destination. I want to grab that destination url but do not know how. Please help.
Thanks,
KC.
url after redirected
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Grab it in.. PHP? Well, that all depends on how the redirection is done. If it's done with headers, cURL, fsockopen(), even get_headers() among others can give you the headers. If it's done via <meta> or Javascript, you'll have to parse the response yourself.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
-
diamondnular
- Forum Newbie
- Posts: 3
- Joined: Sat Mar 03, 2007 9:43 am
Hi feyd, is there a way to know that the redirection is done by something? I even do not know how it is redirectedfeyd wrote:Grab it in.. PHP? Well, that all depends on how the redirection is done. If it's done with headers, cURL, fsockopen(), even get_headers() among others can give you the headers. If it's done via <meta> or Javascript, you'll have to parse the response yourself.
superdezign wrote:Which are you trying to get the destination from? The destination or the source?
Hi superdezign, I want to create a php script, in that I can paste the source url, and after running it, it will give out the destination url.
Thanks,
KC.
-
diamondnular
- Forum Newbie
- Posts: 3
- Joined: Sat Mar 03, 2007 9:43 am