473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to read host header of a site

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

Sep 6 '07 #1
2 2620
On 6 , 14:31, suchismita...@gmail.com wrote:
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

Sep 6 '07 #2
Hello, su***********@gmail.com!

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:

sHi,
sI want to fetch host header of a site url but not getting idea how to
sdo that.
sCan we do by using HttpRequest.ServerVariables.
sI have searched in net but not getting the member through which we
scan fetch the hosturl using these "servervariables".
sCan anyone help me out how to fetch the root level url of a site.
sTIA

Sep 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jay Shen | last post by:
Hi, I have two domains pointing to the same ISP hosted web site. How can I redirect request for www.domain2.com to a sub-folder using header field "host"? Thanks a lot... J-
9
by: Jeff | last post by:
Is there a way to echo back a case sensitive $HTTP_HOST in PHP? For example if I type HostName.domain.com in my browser I want to return it exactly as it appears in the location part of the browser...
1
by: Frogbčrt | last post by:
Config: Win2K, IIS5.0 My solution requires that the host header sent to IIS be analyzed. I have set up a web site that responds to both www.domain.com and domain.com. In DNS, both a WWW and a *...
2
by: Jeff S | last post by:
What are my options if I want to host hundreds of sites on one IIS server (like Internet presence providers do); such that site1.com, site2.com, site3.com... site278.com... are all hosted on the...
5
by: Pietro | last post by:
Hello, I have several sites hosted in iis, they differer by Host Header, ex: www.mysite.com.br, but i want to open all subdomains in that site , ex: www.*.mysite.com.br, is there any sintax to...
7
by: GopherGold | last post by:
I have a site that uses a combination of Web.Sitemap and a SqlSiteMapProvider that I created (thanks to Jeff Proisse @ MSDN). One node of the Web.Sitemap is the same as the root node from the...
0
by: | last post by:
Hi here is the situation we have IIS site with multiple host headers based on host header we need to send to different URL's within the server my current solution (hate to call it naive :)...
0
by: =?Utf-8?B?RG9u?= | last post by:
I've created a website at port 80, with a hostheader of "TestLab". The site is configured for Integrated Security; identity impersonate="true". I can access the website from an external server...
7
by: lmeyers | last post by:
I implemented a URL rewriter which worked reasonably well, but now I am creating other sites on the same server (single IP). Because IIS will not accept subdomain wildcards (*.subdomain.com), it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.