Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > working with personalized host headers using ASP

Reply
Thread Tools

working with personalized host headers using ASP

 
 
Frogbčrt
Guest
Posts: n/a
 
      11-24-2003
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


 
Reply With Quote
 
 
 
 
Frogbčrt
Guest
Posts: n/a
 
      11-24-2003
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" <(E-Mail Removed)> wrote in message
news:3fc1e01c$0$20318$(E-Mail Removed)4al 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with wsgiref.headers.Headers Phil Python 4 01-17-2010 04:47 PM
how to refer a control in the host page from a user control if the host page using masterpage Jerry Qu ASP .Net 1 02-20-2009 07:41 PM
How to develop a blog or personalized site with ASP.NET 2.0 RedHair ASP .Net 6 02-03-2006 07:38 PM
deploy crystal reports on production server using host headers Tim_Mac ASP .Net 3 04-01-2005 04:37 PM
Reading 'received' headers: Email Headers Parsing dont bother Python 0 03-03-2004 08:18 PM



Advertisments