• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 409
  • Last Modified:

Referring URL

What is the difference between Request.Url and Request.UrlReferrer  and Request.ServerVariables("HTTP_REFERER")?

I'm trying to set the referring url

And is there a dirrerence if they arrive from a hyperlink?
0
lrbrister
Asked:
lrbrister
2 Solutions
 
CodeCruiserCommented:
I think Request.UrlReferrer picks up the HTTP_REFERER variable. request.URL is the CURRENT url whereas request.UrlReferrer is the PREVIOUS url.
0
 
Rainer JeschorCommented:
Hi,
Request.Url is the current requested URL.
Request.UrlReferer and Request.ServerVariables("HTTP_REFERER") should be identical and are the url from where the current request has been initiated (e.g. Page A has a link to Page B then the referer on the Page B load will be Page A).
But you cannot rely on this information as proxies and firewalls can be configured to deny sending this information hence the values will be NULL.

Good explanation:
http://www.kruegerwebdesign.com/blog/request-urlreferrer-is-null-what-gives

And the property is read-only therefore you cannot set it in code.

HTH
Rainer
0
 
lrbristerAuthor Commented:
Thanks
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now