473,473 Members | 2,134 Online
Bytes | Software Development & Data Engineering Community
Create 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>
TheVirtualServer=GetVirtualServer(Request.Somethin g("URL"),".domain.com")
If TheVirtualServer then
Response.Write TheVirtualServer & " was entered"
Else
Response.Write "No virtual server name was supplied"
End If

Function GetVirtualServer(TheURLEntered, TheDomainToBeChecked)
GetVirtualDomain=Left(TheURLEntered,Instr(1,TheURL Entered,
TheDomainToBeChecked)-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.domain.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 2986
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.xs4al l.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>
TheVirtualServer=GetVirtualServer(Request.Somethin g("URL"),".domain.com")
If TheVirtualServer then
Response.Write TheVirtualServer & " was entered"
Else
Response.Write "No virtual server name was supplied"
End If

Function GetVirtualServer(TheURLEntered, TheDomainToBeChecked)
GetVirtualDomain=Left(TheURLEntered,Instr(1,TheURL Entered,
TheDomainToBeChecked)-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.domain.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
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...
3
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...
3
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...
3
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...
3
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...
4
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...
0
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...
3
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...
3
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...
0
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...
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...
1
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.