Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP - How to get URL of Referring Site

Tags:

asp-classic

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?

like image 551
StackOverflowNewbie Avatar asked Feb 18 '10 04:02

StackOverflowNewbie


People also ask

How do you get a referral URL?

$_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.

What are referrer urls?

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.

Why is HTTP referer empty?

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.


1 Answers

referer = Request.ServerVariables ("HTTP_REFERER")

like image 199
Alex Avatar answered Sep 22 '22 06:09

Alex