hosting 3 seperate domains in basic package, as seperate apps with starting points

Discussion in 'DNS/Domain names' started by smartgrid, Dec 4, 2010.

  1. looking for help in standing up 3 distinct sites/domains under my basic Winhost package and starting points. This should be simple but, its seems fairly complex with Winhost :confused:

    I have 3 domains as separate sites which I want to host here from, the first domain ( was easy, since it was in root. From the screen shots on features, Winhost lists
    • unlimited domains, (this doesn't happen to be a TLD or root domain), so what do they mean here exactly?
    • unlimited sub-domains (this is not what I want)

    Now how do I get these 2 sites up each with their own content/separate app (not aliases, or sub-domains), like so?
    3. - root

    I have been told by support to use domain pointers, but that only points me back to the root app ( Secondly, I have also been told to use the URL rewrite, for a trailing part of the URL, and not the domain part of the URL.

    I just need some guidance, or a snippet and help in being able to stand up these three websites, like they were their own domains, and customers from one site don't see another domain name in the URL.
    Last edited by a moderator: Oct 14, 2015
  2. Ray


    What do you mean by...

    for a trailing part of the URL, and not the domain part of the URL.

    What you are trying to do can only be done with the use of a domain pointer and URL Rewriting. For the most part this is what our customers do to get a lot of websites hosted under one site account so that they can only pay one monthly plan.

    If you need each site to have its own root folder, its' own email account, its' own web space, and its' own FTP user, then you will need to purchase a new site account for each website.
  3. What I meant was - I don't want any part of showing up in

    I want them to be separate websites experiences.

    -Domain Pointer
    I am okay with putting the remaining websites in sub folders and not root folders. When I set up the domain pointer, I didn't see an option to map the incoming to the sub-folder (/domain2/website) I played around a little on the test panel and gave up.

    Please help correct/refine this understanding I have
    • Earlier -Here is what I understood earlier, the domain pointer will map any of my incoming/redirected domains to specific sub folders.
    • Current - Now, I am understanding from your reply that - all domain pointers map to the root folder and I don't have an option of mapping to sub folder. So, I need to use URL rewrite to grab a hold of the request and send it to a sub-folder. Is this correct so far?

    -Url rewrite
    Also, can you please post a sample for the URL rewrite snippet for one domain (hopefully one that works with Ajax, MVC maps, silverlight as well), and help me make sense of the {R:1} part. I can then configure and customize the rest.

    On the back end will all websites share the same database user role?
    How can I tell which app is posting data to the database.
  4. Ray


    The domain name you use with the domain pointer will not change. So, if you type, it will not change to, it will stay to

    Try looking at this kb article for an example code on how to setup a redirect script.

    It has a condition so it can capture the correct domain name being called. The KB article was specifically written for a subdomain name, but it should work with a fully qualified domain name.

    --On the back end will all websites share the same database user role?

    That will depend. If you are on the basic plan you can only have one database so I you will be sharing the same database for the "membership/roles provider". If you are on the Max plan you can have multiple databases.
    Last edited by a moderator: Oct 14, 2015
  5. You can do it by having a script like this in your page.
    In this case I have used the Default.aspx as the director without a codebehind file to make all of my 'sites' similar but you could have this snippet of script at the top of your main Default.aspx page which is also the website page, this way the first website page will have a 'clean' URL but all the others will have to reside in separate folders and the URL in the browser will look something like


    This means that the user can type or even just in their browser but it will magically change to when the page shows (I think this is acceptable).

    <%@ Page Language="C#"%>
    string ClientURL = Convert.ToString(Request.ServerVariables["SERVER_NAME"]).ToUpper();

    if (ClientURL.IndexOf("MYDOMAIN1") > -1)

    else if (ClientURL.IndexOf("MYDOMAIN2") > -1)

    else if (ClientURL.IndexOf("SAUSAGEFACTORY") > -1)

    then in the root of your site you would have a folder for each
    and use the control panel to make each one an application starting point so that you can have a Default.aspx in each folder (a website in each folder).

    now it is possible to use the other type of redirection but I think you get into trouble with relative files if you do.

    A good point here is that you can set up email accounts for each so you can have but you only have one password so you can't really give them to your clients or they can access everything.
  6. Ray you should really stop recommending that knowledge base article, it is one of the worst ways to do have separate websites within the same account.

    The best way to do it is to refer to this post:
    Last edited by a moderator: Oct 14, 2015
  7. This is very interesting and a snippet from the URL Rewrite Module Configuration reference

    says 'the URL produced by this rule will be passed to the IIS request pipeline'

    I think it looks a bit complicated. I used the zero page frameset method to achieve clean URLs so that when you go to one of my sites, for example then when you click on the Contact Us or the Home links the URL doesn't change. It does mean that you have to define the Title for each site in the main Default.aspx file but it is certainly very easy to maintain. Here is my Default.aspx file.

    <%@ Page Language="C#"%>
    string ClientURL = Convert.ToString(Request.ServerVariables["SERVER_NAME"]).ToUpper();
    string TargetURL = "";
    string Title = "";    
    {   TargetURL = "/adm/";
        Title = "Audio Distractive Meditation";       
    else if (ClientURL.IndexOf("FARSTANDDATA") > -1)    
    {   TargetURL = "/fsd/";
        Title = "Farstand Data Ltd.";
    else if (ClientURL.IndexOf("GOODFUNTHINGS") > -1)
    {    TargetURL = "/gft/";
        Title = "Good Fun Things";
    else if (ClientURL.IndexOf("HELPEXCLAMATIONMARK") > -1)
    {   TargetURL = "/hem/";
        Title = "HelpExclamationmark";
    else if (ClientURL.IndexOf("IANSJEWELLERY") > -1)
    {   TargetURL = "/ij/";
        Title = "Ian's Jewellery";
    else if (ClientURL.IndexOf("JETFEVER") > -1)
        TargetURL = "/jet/";
        Title = "Jet Fever";
    else if (ClientURL.IndexOf("PEDLARSFORUM") > -1)
        TargetURL = "/pf/";
        Title = "Pedlars Forum";
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "hTitlep://">
    <html xmlns="">
    <Title> <%=Title%> </Title>
    <frameset rows="100%,*" border="0">
    <frame src="<%=TargetURL%>" frameborder="0" />
    document.removeEventListener('click, clickHandler, true);  
        <form id="form1" runat="server">
    So, giving away some of my crazy ideas here :D
    You could go on and just have this as part of a main website but I prefer to keep things neat by having all of my sites in sub folders. I don't know if there would be any problems with Ajax and stuff? Haven't got that far yet, I don't see that there should be. I got the code from a website somewhere and I'm not entirely sure what the line document.removeEventListener('click, clickHandler, true); does or even if it is strictly necessary, I may try removing it to see. (seems a bit strange syntax as well, only one ' before click ?)
    JetFever is the only site with anything on it at the moment but you can see that it does provide the redirection for the others.

    Just to clarify for any newbies out there what I have done here is just make a redirection script which redirects to folders

    etcetera where each folder is a website of either a static .html type or a dynamic .aspx type, the redirection is just to the folder so it will pickup index.htm or Default.aspx etc. whatever is there. You can develop each website seperately. The website actually appears inside a frame in your main Default.aspx so you can't change the title as you move from page to page within your website but it does have the advantage of that the URL stays the same too so stays the same no-matter if I click on other pages within that website, like it doesn't change to or anything.

    As I say it is only JetFever that has anything on it at the moment (of any significance) but you can see that the redirection is taking place. Here are the sites I have at the moment:

    You can cheat the system by doing something like but I don't see any harm in that and unless there is any really important reason for using the rules method in web.config, i'll just continue to use this as it is easy to understand and maintain plus it gives clean URLs and also it should work for subdomains shouldnt' it? should be able to do a test for SUBDOMAIN.MAINSITE which might give the extra added advantage that you could use the same subdomain name for different sites etc.(note: I don't know if this is possible, haven't tried it yet).

    If anyone knows of any gotchas that I haven't thought of please post.

  8. thats an interesting idea but what if someone wanted to go back to a specific page that they liked or send a link of a certain page to a friend, wouldn't that cause a problem seeing as all of the pages will have the same url pointing to them.

    i haven't had any issues with the URL rewrite module and i think it is actually pretty easy to set up and works fine with ajax as well.
  9. Yes you have a good point as the URL to any specific page doesn't appear in the address bar then it would not be possible to send someone a specific link to a specific page unless perhaps they should right-click on the internal link and choose to open in a new tab or browser instance but this is advanced browsing which many people may not know of.
    I think your method is the correct and most professional method. The one I've used here is just easier to understand and maintain and make changes to. Of course there is no reason why we can't use a combination of both :)

Share This Page