This is an ASP question, not ASP.Net.
Assume there are two sites:
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?
$_SERVER['HTTP_REFERER'] will give you the referrer page's URL if there exists any. If users use a bookmark or directly visit your site by manually typing in the URL, http_referer will be empty.
The address of the webpage where a person clicked a link that sent them to your page. The referrer is the webpage that sends visitors to your site using a link. In other words, it's the webpage that a person was on right before they landed on your page.
There might be several reasons why the referer URL would be blank. It will/may be empty when the enduser: entered the site URL in browser address bar itself. visited the site by a browser-maintained bookmark.
referer = Request.ServerVariables ("HTTP_REFERER")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With