How can I track URL forwarding.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raotnv
Forum Newbie
Posts: 2
Joined: Tue Feb 24, 2009 11:51 am

How can I track URL forwarding.

Post by raotnv »

Dear All

Could any body shed some light on my problem. What I am trying to do is I have one URL1 (http://www.domain1.com) and user click this url1 and which redirects to URL2 (http://www.domain2.com). But my problem here is I know what could be URL1 but never know URL2 which I need to track for some encoded strings in url they append when they loaded. Is there any way I can track the final forwarded URL in php?. or even java script also fine for me if you have some ideas.

Appreciate your help in advance.

Thanks
Rao
~BlitZ
Forum Newbie
Posts: 22
Joined: Mon Feb 23, 2009 5:36 pm
Location: United Kingdom

Re: How can I track URL forwarding.

Post by ~BlitZ »

I got half way through writing something and then understood what you meant lol.

okay, If you have access to Cpanel, If you go to "Logs" and then "AwStats", Thats if you have it of course.
raotnv
Forum Newbie
Posts: 2
Joined: Tue Feb 24, 2009 11:51 am

Re: How can I track URL forwarding.

Post by raotnv »

Thanks for the response. I want to perform these tasks in PHP or javascript dynamically. not to go through logs because I have to perform some validation for each and every user request.

~BlitZ wrote:I got half way through writing something and then understood what you meant lol.

okay, If you have access to Cpanel, If you go to "Logs" and then "AwStats", Thats if you have it of course.
~BlitZ
Forum Newbie
Posts: 22
Joined: Mon Feb 23, 2009 5:36 pm
Location: United Kingdom

Re: How can I track URL forwarding.

Post by ~BlitZ »

Hmm, Okay, I have searched on the internet and couldn't find much, I found a few javascripts though, They seemed a bit too complicated, Well they only thing i can think of is somehow keep track of what user clicks where.

My idea:
Say a user clicks the homepage and you want to see what link he clicked and when, Couldn't you store this in the DB somehow?.
Try a string that echo's the url but will also record what time and what link it clicked.
Post Reply