There are 2 issues here.
The first issue is that you should not settle for a host that is so
inflexible. I moved all my domain names to GoDaddy.com. They're the
least expensive, and they offer the most features. Among other things,
you can set up unlimited subdomains. Each subdomain can use what they
call "forwarding" which really means they set up a redirect script on
their end behind the scenes which redirects all requests for that
subdomain to the URL that you specify. This URL can be *any* URL you
like. You can forward your subdomain to
http://www.BushIsEvil.com/1000reasons.html if you want to--they don't
care. Alternatively, each subdomain can instead use an A record, which
is a type of DNS record, to assign the subdomain an IP address. This
supports all IP applications, not just HTTP. ...or you can use CNAME
records, another type of DNS record, which points the subdomain at a
different domain or subdomain at the DNS level so when clients do a DNS
look-up for, say, Bush.EvilDudes.com, the DNS server returns the IP
addres for, say, www.whitehouse.gov. And these are just some of the
features they provide--all included when you register a domain name with
them. The possibilities are endless. If your host does not require
that your domain name be hosted by their DNS servers, I highly recommend
GoDaddy.com for domain name registration and DNS hosting.
The second issue is the script. If you *must* use a script, it's quite
easy. Just create a file named index.asp that contains the following
code:
<%
If
InStr(Lcase(Request.ServerVariables("SERVER_NAME")),"yourdomaininlowerca
se.com") <> 0 Then
Response.Redirect("/SubFolderForDomain/index.asp")
Else
Response.Redirect("/DefaultFolder/index.asp")
End If
%>
That should be pretty self explanatory. Just let me know if you have
questions.
If you had more control of the server, you could also set up redirects
at the server level instead of the page code level. For instance, if
the web server is IIS, you could open the IIS MMC snap-in, right-click
the file that you want to be the redirecting page, choose properties,
and specify the redirect destination.
Hope that helps!
- Vieth
> -----Original Message-----
> From: professorw999 [mailto:[EMAIL PROTECTED]
> Sent: Thursday, November 04, 2004 12:03 PM
> To: [EMAIL PROTECTED]
> Subject: [ASP] ASP And Subdomains
>
>
>
> I have never used a subdomain before and would like to try.
> Our web host will set up this subdomain for us:
> http://articles.independent-sales-reps.com
>
> We want this subdomain to point to this page: /articles.asp
> However, our web host states that all subdomains may only
> point to our home page: /index.asp
>
> In order to have a subdomain point to a different web page,
> we need to use some sort of scripting. They will not offer
> any further technical support than that.
>
> Does this sound right? Has anyone used an ASP script to
> accomplish what I want to do here?
>
> Thanks,
> PW
>
>
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~--> Make a clean sweep of pop-up ads.
> Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/17folB/TM
> --------------------------------------------------------------
> ------~->
>
> --------------------------------------------------------------
> -------
> Home : http://groups.yahoo.com/group/active-server-pages
> ---------------------------------------------------------------------
> Post : [EMAIL PROTECTED]
> Subscribe : [EMAIL PROTECTED]
> Unsubscribe: [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/17folB/TM
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [EMAIL PROTECTED]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/