Create subdomain

Discussion in 'General troubleshooting' started by Gabriel, Apr 23, 2013.

  1. Last edited by a moderator: Oct 14, 2015
  2. Elshadriel

    Elshadriel Winhost Staff

    Last edited by a moderator: Oct 14, 2015
  3. I tried with the script below, the main site is ok but not the subdomain, the error is "Google Chrome could not find sub1.mydomain.com" (same with other browser)

    The script is :
    Code:
    <?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.mydomain.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="^sub1.mydomain.com$" />
    		</conditions>
    		<action type="Rewrite" url="sub1/{R:1}" />
    	</rule>
    	</rules>
    </rewrite>
    </system.webServer> 
    
    </configuration>
    
     
    Last edited by a moderator: Oct 14, 2015
  4. Elshadriel

    Elshadriel Winhost Staff

    Did you create a subdomain with the Subdomain Manager tool in the Control Panel?
     
  5. Yes, I created the subdomain.
     
  6. Elshadriel

    Elshadriel Winhost Staff

    I would have to take a look at your site. You can send me a private message regarding the domain name so I can look it up if you do not want to display it here.
     
  7. I sent the domain name in private
     
  8. Elshadriel

    Elshadriel Winhost Staff

    Thanks. I also sent you a response already.
     
  9. Hi, Elshadriel,.

    i have the same error when hosting subdomain. please help me too.
     
  10. Elshadriel

    Elshadriel Winhost Staff

    What's the domain name of your site?
     
  11. I have a similar issue. Should I contact you directly?
    Thanks for your help,
    Yanko
     
  12. Elshadriel

    Elshadriel Winhost Staff

    Sure, you can send me a message.
     
  13. I think I fixed the first half of my problem, but I still cannot get it to point to the subdomain...
     
  14. Similar issue: I am trying to point subdomain http://perfectlypaired.bernhardtwinery.com to a subdirectory http://bernhardtwinery.com/perfectlypaired with no luck. I've tried the IIS URL rewrite and also editing the web.config directly using several different examples from the forums - still no luck. Can anyone assist? This is what I have:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <defaultDocument>
    <files>
    <clear />
    <add value="index.asp" />
    <add value="index.html" />
    <add value="default.html" />
    <add value="default.htm" />
    <add value="default.asp" />
    </files>
    </defaultDocument>
    <rewrite>
    <rules>
    <rule name="Redirect subdomain" enabled="true">
    <match url="^(.*)$" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^perfectlypaired\.bernhardtwinery\.com$" />
    </conditions>
    <action type="Rewrite" url="perfectlypaired/{R:1}" />
    </rule>
    </rules>
    </rewrite>
    <directoryBrowse enabled="false" />
    </system.webServer>
    </configuration>
     
  15. Elshadriel

    Elshadriel Winhost Staff

    This should be the correct rule markup:

    Code:
    <rewrite>
      <rules>
        <rule name="Rewrite to perfectlypaired.bernhardtwinery.com" stopProcessing="true">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^perfectlypaired.bernhardtwinery.com$" />
          </conditions>
          <action type="Rewrite" url="perfectlypaired/{R:1}" />
        </rule>
      </rules>
    </rewrite>
    
     
    Michael likes this.

Share This Page