• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the URL of the page which redirected to our site ?  RSS feed

 
Vinodh Sa
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a small question here. My problem is to fetch the URL of the page which redirected to our site. Suppose, say there is a site www.abc.com, which has a link to www.xyz.com. Andif any one clicks on that link in the abc's site, then it will re-direct to xyz. But without directly getting any inputs from abc, how can the site xyz fetch the url of abc(the site which re-directed to xyz).

Is there any way to do this ?

Note : Both sites are deployed in totally different servers.
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can obtain that value from the Referer header
 
Vinodh Sa
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sudhir nim wrote:You can obtain that value from the Referer header


Thanks Sudhir !!!
I will try the same and will revert you.....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66156
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that this header may not always be set.
 
Vinodh Sa
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Be aware that this header may not always be set.


Hi Bibeault,

Is there any other possible way to achieve the same, which is more reliable ? Because i would need a more reliable approach.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66156
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, afraid not. The most reliable way is for the redirecting site to provide you with that info. Failing that, there is no 100% guaranteed means.
 
Vinodh Sa
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:No, afraid not. The most reliable way is for the redirecting site to provide you with that info. Failing that, there is no 100% guaranteed means.


Ok... But currently that redirecting site cannot provide me that info. So i have to go with the above approach only, even though its not 100% reliable. Later i will change my approach after getting the info from the redirecting site.

But THANKS anyway Bibeault
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!