How to read host header of a site

  • Thread starter Thread starter suchismita.83
  • Start date Start date
S

suchismita.83

Hi,
I want to fetch host header of a site url but not getting idea how to
do that.
Can we do by using HttpRequest.ServerVariables.
I have searched in net but not getting the member through which we can
fetch the hosturl using these "servervariables".
Can anyone help me out how to fetch the root level url of a site.
TIA
 
Hi,
I want to fetch host header of a site url but not getting idea how to
do that.
Can we do by using HttpRequest.ServerVariables.
I have searched in net but not getting the member through which we can
fetch the hosturl using these "servervariables".
Can anyone help me out how to fetch the root level url of a site.
TIA

Request.Headers - headers
Request.Url.Host - host name of your application
Request.UserHostName - host name of visitor

Mykola
http://marss.co.ua
 
Hello, (e-mail address removed)!

You're looking for a "Host" HTTP header.

You can use HttpRequest.Headers to retrieve that header.

Also you can use HttpRequest.UserHostAddress property.

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Thu, 06 Sep 2007 04:31:04 -0700:

s> Hi,
s> I want to fetch host header of a site url but not getting idea how to
s> do that.
s> Can we do by using HttpRequest.ServerVariables.
s> I have searched in net but not getting the member through which we
s> can fetch the hosturl using these "servervariables".
s> Can anyone help me out how to fetch the root level url of a site.
s> TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top