473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

working with personalized host headers using ASP

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 * A record exist, so either www.domain.com or
domain.com gets directed to the same web site. However, I wish for
whatever.domain .com to point to the same web site and for my ASP page to
analyze the URL to determine what (if any) was entered BEFORE domain.com. A
VERY simple example would look like this:
<begin example>
TheVirtualServe r=GetVirtualSer ver(Request.Som ething("URL")," .domain.com")
If TheVirtualServe r then
Response.Write TheVirtualServe r & " was entered"
Else
Response.Write "No virtual server name was supplied"
End If

Function GetVirtualServe r(TheURLEntered , TheDomainToBeCh ecked)
GetVirtualDomai n=Left(TheURLEn tered,Instr(1,T heURLEntered,
TheDomainToBeCh ecked)-1)
End Function
<end example>

Now a user entering "domain.com " as the url should get "No virtual server
name was supplied", whereas a user entering "anything.domai n.com" would see
"anything was entered". The challenge: how to have a web server with
www.domain.com and "domain.com " (and/or *.domain.com) as configured host
header to handle ANY request ending in "domain.com " AND how to analyze the
URL passed by the user?

Thanks,
Rob
Jul 19 '05 #1
1 2999
Regarding: if I configure a web site with NO host header, any URL that would
point to an unspecified host header (regardles the domain) would be
redirected to that website. I could write a handler on that website to
redirect to the specific domain. However, configuring a website without a
host header implies a security risk, as this leaves the server vulnerable to
attacks by worms that approach an IP address directly. Is there a
workaround?
(Previous post included for clarity)
"Frogbčrt" <aa@aa.aa> wrote in message
news:3f******** *************** @dreader7.news. xs4all.nl...
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 * A record exist, so either www.domain.com or
domain.com gets directed to the same web site. However, I wish for
whatever.domain .com to point to the same web site and for my ASP page to
analyze the URL to determine what (if any) was entered BEFORE domain.com. A VERY simple example would look like this:
<begin example>
TheVirtualServe r=GetVirtualSer ver(Request.Som ething("URL")," .domain.com")
If TheVirtualServe r then
Response.Write TheVirtualServe r & " was entered"
Else
Response.Write "No virtual server name was supplied"
End If

Function GetVirtualServe r(TheURLEntered , TheDomainToBeCh ecked)
GetVirtualDomai n=Left(TheURLEn tered,Instr(1,T heURLEntered,
TheDomainToBeCh ecked)-1)
End Function
<end example>

Now a user entering "domain.com " as the url should get "No virtual server
name was supplied", whereas a user entering "anything.domai n.com" would see "anything was entered". The challenge: how to have a web server with
www.domain.com and "domain.com " (and/or *.domain.com) as configured host
header to handle ANY request ending in "domain.com " AND how to analyze the
URL passed by the user?

Thanks,
Rob

Jul 19 '05 #2

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

Similar topics

4
1877
by: John | last post by:
Greetings, all, Several days after adding personalized URLs to my "amazing" collection of "God Loves (yourname)" mazes, it occurred to me that if someone were to create an offcolor term, then copy the URL to his own web page, that I might be penalized because my page would include that text on the resulting page. For example, let's say that "GOD LOVES JOKES" has negative connotations. Someone could create:
3
1528
by: Karl Easterly | last post by:
Hi. I have a site running with a FQDN which is addressed using host headers. Instead of working with the project through a mapped drive, I would like to work with it via the concept implied as 'open->project from web'. I have no problem working with it via the mapped drive, even debuggin is fine. I am sure it is a simple setting I need to toggle, but I do not know which. I tried web sharing the folder but when I open in this mannor I
3
2977
by: Tim_Mac | last post by:
hi, see quote below from http://groups.google.ie/groups?hl=en&lr=&th=36c5d2df211a4d78&seekm=00480961-660F-462D-BBD4-455C8DA26C38%40microsoft.com&frame=off According to the book: "Deploying .NET Applications Lifecycle Guide" published in Microsoft Press: "Web setup projects allow you to specify which port to install the application on, they do not currently support deployment of a Web application to a site differentiated by host...
3
6915
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication as per RFC 2617 (http://www.faqs.org/rfcs/rfc2617.html). My attempts to authenticate are failing. The server requires the header to be present with the request. For security reasons, it will not reply in any way if the header is not present. ...
3
2037
by: Ashhad Syed | last post by:
I have turned on smartnavigation=True for some of the forms in my .NET application. It seemed to be working fine on Windows 2000 SP4, which also has VS 2003 installted, but when I moved the application to window 2003 production evnironment, the Smartnavigation stopped working. Any ideas or suggestions would be appreciated. Thanks, Ashhad.
4
1593
by: Alexander | last post by:
Hi, for some reason it seems PHP is not properly passing the sender's address to sendmail. It does not matter whether I add "From" as header, "nobody@new" is always taken as originating addres (be it return-path, from or sender). sendmail logs the following line SMTP error from remote mailer after MAIL FROM:<nobody@new>
0
915
by: Gabriel Genellina | last post by:
En Mon, 14 Apr 2008 01:04:40 -0300, Penny Y. <pylists@arcor.deescribió: Add a `headers` parameter to the request method. See http://docs.python.org/lib/httpconnection-objects.html Something like this (untested): headers = {'Host', 'the.host.name'} conn = httplib.HTTPConnection("192.168.1.1") conn.request("GET", "/", headers=headers)
3
15665
by: Sarah | last post by:
I was wondering if someone might be able to help me with this issue. I have a feeling this has something to do with my host's server settings as I used to be able to get CURL to follow redirects by setting CURLOPT_FOLLOWLOCATION set to true. I had a problem with my host's updating something in the past that gave me the error "CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set". My host worked on the...
3
4526
by: teddarr | last post by:
I have a Windows Server 2003. I am trying to run multiple websites on the server. I have 3 different websites I'd like to run. Currently the default website is working but no others. All the domains have an a record pointing to the network router. The router is conficured correctly to send all website requests to my server. One the server and for each website I went to the IIS manager on the Websites tab and have the IP address set...
0
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8627
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.