Second site on subdomain cannot be found but first site works fine...need help

Discussion in 'DNS/Domain names' started by Sayeed Rahman, May 30, 2015.

  1. Hi:

    I have two domains( sayeedinstitute.org and codemagnet.net), both registered through Winhost.
    I am trying to set up two applications under the 'Site' named 'sayeedinstitute.org'.

    I have created two sub-folders under the root folder (root/SayeedInstitute and root/CodeMagnet), and have uploaded two applications (www.sayeedinstitute.org and www.codemagnet.net) on these sub-folders. The first one (www.sayeedinstitute.org) works meaning the site is available, but the second one (www.codemagnet.net) is not functioning with the error message "The webpage is not available".

    I have the followed the instructions on this forum thread "http://forum.Winhost.com/threads/how-to-mulitple-sites-on-one-account.4545/".

    In the root directory, I have only three folders (App_Data, SayeedInstitute, CodeMagnet) and a web.config file with the following code in the web.config file:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <clear />
    <rule name="Canonical Host Name sayeedinstitute" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^www\.sayeedinstitute\.org$" />
    </conditions>
    <action type="Redirect" url="http://sayeedinstitute.org/{R:1}" />
    </rule>
    <rule name="Canonical Host Name codemagnet" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^www\.codemagnet\.net$" />
    </conditions>
    <action type="Redirect" url="http://codemagnet.net/{R:1}" />
    </rule>

    <rule name="sayeedinstitute" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^(www\.)?sayeedinstitute\.org$" />
    <add input="{PATH_INFO}" pattern="^/sayeedinstitute($|/)" negate="true" />
    </conditions>
    <action type="Rewrite" url="\sayeedinstitute\{R:0}" />
    </rule>
    <rule name="codemagnet" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
    <add input="{HTTP_HOST}" pattern="^(www\.)?codemagnet\.net$" />
    <add input="{PATH_INFO}" pattern="^/codemagnet($|/)" negate="true" />
    </conditions>
    <action type="Rewrite" url="\codemagnet\{R:0}" />
    </rule>

    </rules>
    </rewrite>
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
    </system.webServer>
    </configuration>


    In accordance with the instructions provided on the above mentioned link, I also have inserted rewrite rules in www.sayeedinstitute.org's web.config (on the root of the subdomain) the following code which works:
    <!-- ==================================================================== -->
    <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
    <remove name="UrlRoutingModule-4.0" />
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />
    </modules>
    <!-- RULES FOR SUBDOMAIN-->
    <rewrite>
    <outboundRules>
    <rule name="Outgoing - URL paths" preCondition="Not .axd files" enabled="true">
    <match filterByTags="A, Form, Img, Input, Link, Script" pattern="^(?:sayeedinstitute|(.*//[_a-zA-Z0-9-\.]*)?/sayeedinstitute)(.*)" />
    <conditions>

    </conditions>
    <action type="Rewrite" value="{R:1}{R:2}" />
    </rule>
    <rule name="response_location URL">
    <match serverVariable="RESPONSE_LOCATION" pattern="^(?:sayeedinstitute|(.*//[_a-zA-Z0-9-\.]*)?/sayeedinstitute)(.*)" />
    <conditions>
    <add input="{URL}" negate="true" pattern="\.axd$" />
    </conditions>
    <action type="Rewrite" value="{R:1}{R:2}" />
    </rule>
    <rule name="response_location querystring">
    <match serverVariable="RESPONSE_LOCATION" pattern="(.*)%2fsayeedinstitute(.*)" />
    <conditions>
    <add input="{URL}" negate="true" pattern="\.axd$" />
    </conditions>
    <action type="Rewrite" value="{R:1}{R:2}" />
    </rule>
    <preConditions>
    <preCondition name="Not .axd files">
    <add input="{URL}" pattern="\.axd" negate="true" />
    </preCondition>
    </preConditions>
    </outboundRules>
    </rewrite>
    <urlCompression doStaticCompression="false" doDynamicCompression="false" />
    <!-- END OF RULES FOR SUBDOMAIN-->
    </system.webServer>
    <!-- =============================================================== -->


    However, the similar rewrite code that I inserted into the web.config of www.codemagnet.net does not work. The rewire script is as follows:
    <!-- ===================================================================== -->
    <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
    <remove name="UrlRoutingModule-4.0" />
    <add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" />
    </modules>
    <!-- RULES FOR SUBDOMAIN-->
    <rewrite>
    <outboundRules>
    <rule name="Outgoing - URL paths" preCondition="Not .axd files" enabled="true">
    <match filterByTags="A, Form, Img, Input, Link, Script" pattern="^(?:codemagnet|(.*//[_a-zA-Z0-9-\.]*)?/codemagnet)(.*)" />
    <conditions>
    </conditions>
    <action type="Rewrite" value="{R:1}{R:2}" />
    </rule>
    <rule name="response_location URL">
    <match serverVariable="RESPONSE_LOCATION" pattern="^(?:codemagnet|(.*//[_a-zA-Z0-9-\.]*)?/codemagnet)(.*)" />
    <conditions>
    <add input="{URL}" negate="true" pattern="\.axd$" />
    </conditions>
    <action type="Rewrite" value="{R:1}{R:2}" />
    </rule>
    <rule name="response_location querystring">
    <match serverVariable="RESPONSE_LOCATION" pattern="(.*)%2fcodemagnet(.*)" />
    <conditions>
    <add input="{URL}" negate="true" pattern="\.axd$" />
    </conditions>
    <action type="Rewrite" value="{R:1}{R:2}" />
    </rule>
    <preConditions>
    <preCondition name="Not .axd files">
    <add input="{URL}" pattern="\.axd" negate="true" />
    </preCondition>
    </preConditions>
    </outboundRules>
    </rewrite>
    <urlCompression doStaticCompression="false" doDynamicCompression="false" />
    <!-- END OF RULES FOR SUBDOMAIN-->
    </system.webServer>
    <!-- ==================================================================== -->

    Is there something that I am not catching but is obviously wrong or is it that the problem is of different nature? Any help will be appreciated. I apologize for the verbose and long explanation of the circumstance and the problem, but hope that it will help others in the future once the problem is resolved.

    Best regards,
    Sayeed
     
    Last edited by a moderator: Oct 14, 2015
  2. ComputerMan

    ComputerMan Winhost Staff

    Last edited by a moderator: Oct 14, 2015
    Michael likes this.

Share This Page