Two Sites on a Single Winhost Site Account

Discussion in 'DNS/Domain names' started by lookitskris, Sep 1, 2011.

  1. Right, I’m so close to getting this I can smell victory.

    I’m trying to host two sites on a single Winhost site account.

    1. www.mydomain .com should map to a MAIN folder (this is a standard ASP.NET site)

    2. blog.mydomain.com should map to BLOG (this is wordpress site, with the A record set up accordingly)

    In the root folder I have the the two folders (which contain the site files for each) and a single web.config file wich contains the following URL rewrite stuff (I got this off a blog site but I can’t remember where exactly, so props to the dude that originally wrote it)

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <rewrite>
    <rules>

    <rule name="Rewrite to folder1" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^www.mysite.com$" />
    </conditions>
    <action type="Rewrite" url="Main/{R:1}" />
    </rule>
    <rule name="Rewrite to folder2" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^mysite.com$" />
    </conditions>
    <action type="Rewrite" url="Main/{R:1}" />
    </rule>
    <rule name="Rewrite to folder3" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^blog.mysite.com$" />
    </conditions>
    <action type="Rewrite" url="blog/{R:1}" />
    </rule>

    </rules>
    </rewrite>

    </system.webServer>

    </configuration>

    Right now, hitting mysite.com or www.mysite.com is working fine, but hitting blog.mysite.com (which is the wordpress install) brings up the Winhost “web page is unavalalbe” page.

    I know that wordpress is working properly as I was able to configure it and get it working by going to www.mysite.com/blog/wp-install or whatever and run through the set up process.

    I know noting about url rewriting, but my gut is saying that the problem lies with the {R:1} after blog, as its wordpress this might cause problems?

    Any help would be fantastic!

    Kris
     
    Last edited by a moderator: Oct 14, 2015
  2. Thanks for your patience with this configuration. It is likely you will need to create a domain pointer to get past the problem you are having. See the following article:

    https://support.Winhost.com/KB/a696/details-on-domain-pointer-service.aspx

    Instruction number 3 of the articles points out the following:

    "We do not point additional domains to subdirectories. To point domain pointers to subdirectories you will need to use a redirect script."

    So it seems you will need to create this domain pointer and then you should be able to see the site based on the script you are using. Please let us know if there are any other issues you run across or if this helps to resolve your issue.
     
    Last edited by a moderator: Oct 14, 2015

Share This Page