How to set up subdomains?

Discussion in 'DNS/Domain names' started by JeffG, Dec 18, 2010.

  1. Hi,

    I have a website hosted by you guys, http://www.jeffreygetzin.com. It runs an ASP.NET application that I've written.

    I would like to set up a blog using a third-party ASP.NET blogging application. It too is configured to run as an ASP.NET application.

    My idea is to set up a subdomain: blog.jeffreygetzin.com.

    To implement this, I created the subdomain from the user control panel. Now, I'd like to create a "blog" directory and have my subdomain point to that so that my blogging software runs as-is, as if it were the only ASP.NET application on this system. How do I do that?

    Thanks, guys! :)

    Jeff
     
  2. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  3. Hi,

    Thanks for the quick reply.

    Isn't there a way I can do this without a redirect script? That seems an incredibly clunky solution, and anyway, I already have a default document for my root directory. It seems like something I could just put in my web.config, no?

    Now, the link for the application starting point says, "Warning: Improper use of this tool can render your web site nonfunctional!" Will setting a subdirectory as an application starting point prevent me from using my root level as an application starting point, too?

    Thanks,
    Jeff
     
  4. The redirect script can be coded within your current default document. This will then redirect you subdomain properly.

    If coded properly this should not make your root application, nonfunctional. However, if you run into issues you can re post on this thread or open a support ticket.
     
  5. Hi,

    Thanks for the additional information.

    I enabled the blog/ subdirectory as an application starting point, and I added the following code to the beginning of my default document of my top-level domain:

    Code:
    <% 
    if (Request.ServerVariables["SERVER_NAME"].ToUpper().Contains("blog.jeffreygetzin.com".ToUpper())) 
    {
            Response.Redirect("/blog");
    } 
    %> 
    
    But this doesn't work as I expected it to.

    I expected when I typed in "blog.jeffreygetzin.com" that I would be redirected to the blog/ subdirectory and my URL would appear as blog.jeffreygetzin.com.

    What I got was that I was indeed redirected to that directory, but the URL shows up as "blog.jeffreygetzin.com/blog".

    Furthermore, while most of the blogging application works now, anything involving AJAX seems to be failing. I'm guessing that's because the AJAX calls are not getting redirected by the script I added, whereas everything else uses postbacks and works correctly.

    So what are my next steps?

    Jeff
     
  6. BTW, I'm thinking it needs to be done with rewrite rules. But I don't understand them well enough to get them working...

    I know what a request is, what a response is, and I understand regular expressions ... but how do I use IIS Manager to make my subdomain work? This is so frustrating...
     
  7. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015

Share This Page