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 goDaddy.com, the first domain (www.smartblood.net) 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?
    1. www.agrows.com
    2. www.tussker.com
    3. www.smartblood.net - root

    I have been told by support to use domain pointers, but that only points me back to the root app (smartblood.net). 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

    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 domain1.com showing up in domain2.com.

    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 domain2.com 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.

    -DB
    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

    Ray

    The domain name you use with the domain pointer will not change. So, if you type domain2.com/folder1, it will not change to domain1.com/folder1, it will stay to domain2.com/folder.

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

    http://support.Winhost.com/KB/a649/how-to-redirect-a-subdomain-to-a-subdirectory.aspx

    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 asp.net 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

    www.mydomain1.com/md1

    www.mydomain2.com/md2

    www.sausagefactory.com/sf

    etc.

    This means that the user can type www.sausagefactory.com or even just sausagefactory.com in their browser but it will magically change to sausagefactory.com/sf 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)
    Response.Redirect("/md1/");

    else if (ClientURL.IndexOf("MYDOMAIN2") > -1)
    Response.Redirect("/md2/");

    else if (ClientURL.IndexOf("SAUSAGEFACTORY") > -1)
    Response.Redirect("/sf/");
    %>


    then in the root of your site you would have a folder for each
    md1
    md2
    sf
    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 [email protected] 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: http://forum.Winhost.com/showthread.php?t=4545
     
    Last edited by a moderator: Oct 14, 2015
  7. This is very interesting and a snippet from the URL Rewrite Module Configuration reference http://learn.iis.net/page.aspx/465/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 www.JetFever.com 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.

    Code:
    <%@ Page Language="C#"%>
    <%
    string ClientURL = Convert.ToString(Request.ServerVariables["SERVER_NAME"]).ToUpper();
    string TargetURL = "";
    string Title = "";    
    if (ClientURL.IndexOf("AUDIODISTRACTIVEMEDITATION") > -1)
    {   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://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <Title> <%=Title%> </Title>
    <frameset rows="100%,*" border="0">
    <frame src="<%=TargetURL%>" frameborder="0" />
    </frameset> 
    document.removeEventListener('click, clickHandler, true);  
    </head>
     
    <body>
        <form id="form1" runat="server">
        <div>
        
        </div>
        </form>
    </body>
    </html>
    
    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
    jet
    fsd
    gft

    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 www.jetfever.com stays the same no-matter if I click on other pages within that website, like it doesn't change to www.jetfever.com/AboutUs.htm 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:

    www.audiodistractivemeditation.com
    www.farstanddata.com
    www.goodfunthings.com
    www.helpexclamationmark.com
    www.iansjewellery.com
    www.jetfever.com
    www.pedlarsforum.com

    You can cheat the system by doing something like www.helpexclamationmark.com/jet 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 bournemouth.goodfunthings.com bournemouth.jetfever.com 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.

    ian
     
  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