ASP - How to get URL of Referring Site

StackOverflowNewbie picture StackOverflowNewbie · Feb 18, 2010 · Viewed 20.5k times · Source

This is an ASP question, not ASP.Net.

Assume there are two sites:

  1. www.domain-1.com
  2. www.domain-2.com

www.domain-1.com has a redirection URL in IIS that points to www.domain-2.com. In www.domain-2.com, I need to know the URL of the referring site (e.g. in this case, it would be www.domain-1.com). How is this done?

Answer

Alex picture Alex · Feb 18, 2010

referer = Request.ServerVariables ("HTTP_REFERER")