Nov 17 2008

Hosting multiple domains on one DiscountASP.Net account

I embarked on the task of setting up a blog for myself a few days back. One of the difficulties for me was justifying the cost of setting up yet another hosting account @ $10 per month. I already have several accounts open and most have LOTS of space and bandwidth remaining on them. This got me wondering if I could host multiple domains on one account. Well, at my host www.DiscountASP.NET (which is an awesome host btw), they now have what they call Root Domain Pointers. Setting up one of these allows you to point an additional domain name at your web application root. That is all fine and dandy, however, all that really does is allow you to point more than one domain name at the same exact site. That is really cool if that is what you want to accomplish. What I wanted to accomplish,  however, was to have two distinct domains point to two distinct sites and to the user appear, well, distinct!

Here is what I did

I already had a site (WilliamsWebZone.com), but I also wanted a blog site (Richard Will.Net). So I moved the main site WWZ to a sub folder off of the site root folder and made it a .Net application in IIS. I then added another sub folder for my blog site and also made it a .Net application in IIS. Then in the site root folder I placed a little asp page with the script below in it that is basically supposed to redirect the user to the appropriate sub folder. Now, as I understood it, it was supposed to work so that the sites hit their respective sub folders and the URL looked like they were at the root folder. But here is what is really happening. User keys in http://www.williamswebzone.com/ and then the URL updates and says www.williamswebzone.com/wwz. Any one have any ideas? I understand what is going on to some degree. I understand basically that the server is still looking at the actual root folder as the root folder instead of looking at the sub folder as the root folder. But how do I fix that? I tried Server.Transfer, but then I ran into other issues.

Here is the script:

<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")),  UCase("williamswebzone.com") ) > 0 Then
        Response.Redirect("/wwz")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("richardwill.net") ) > 0 Then
        Response.Redirect("/richardwill")
End If
%>

Interesting Links

Article on "URL Mapping" feature of ASP.NET

Link to open source .NET "URL Rewriting" tool

Link to my post for help on DiscountASP.NETs forum

Article on the difficulties of hosting a nested .NET applications 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5