Subdomain setup

Discussion in 'Domain names/DNS' started by tjm6f4, Nov 19, 2015.

  1. After creating the subdomain on my site, I'm not quite sure which directory it points to.

    What are the next steps after creating the subdomain in cp.everleap.com?
     
  2. Martin Ortega

    Martin Ortega Everleap staff

    You point it to the subdirectory you want to point it to.

    To redirect subdomains or domain pointers to specific directories, we have some redirect information and sample code in our Knowledge Base, at: http://support.discountasp.net/KB/a369/how-to-redirect-a-subdomain-to-a-subdirectory.aspx.

    You can also the URL Rewrite to complete the redirect. http://stackoverflow.com/questions/16027389/iis-redirect-subdomain-to-subfolder-on-same-subdomain

    Or check this web page article out here: https://benpowell.org/winhost-com-how-to-really-run-multiple-sites-under-one-account/
     
    mjp likes this.
  3. I really like the setup described in the last link. Very simple and powerful. I'm a bit confused by one step: configure your “Application Starting Points”. How is this done in the Everleap cp.panel? My main site is working correctly and directing to /main but my subdomains are not. It seems that this step is likely what I'm missing.

    Also a tip to anyone else doing this: Each rule requires a unique NAME property or you get a duplicate KEY error.
     
    Last edited: Jan 9, 2016
  4. Takeshi

    Takeshi Everleap staff

    In the Everleap control panel you have the App Roots tool in the Site manager.
     
  5. Thanks! I had already done that, but wasn't sure that was what the blog was referencing. I did get some help with this, and was encouraged to modify by REWRITE rule for the subdomains as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <system.webServer>
    <rewrite>
    <rules>
    <rule name="SUBDOMAIN.PRIMARYSITE.com to sub folder" enabled="true" stopProcessing="true">
    <match url="(.*)" ignoreCase="true" />
    <conditions logicalGrouping="MatchAll">
    <add input="{HTTP_HOST}" pattern="^SUBDOMAIN\.PRIMARYSITE\.com$" ignoreCase="false" />
    <add input="{PATH_INFO}" pattern="^/SUB_FOLDER($|/)" negate="true" />
    </conditions>
    <action type="Rewrite" url="\SUBDOMAIN\{R:0}" />
    </rule>
    </rules>
    </rewrite>
    </system.webServer>
    </configuration>

    Seems to work. There's a bit more going on here then I understand yet, but I'll figure it out. Working examples really help.
     
  6. hi
    you have to redirect you subdomain to right place. You have to create folder for your subdomain. Public_html is for the main domain( the first you buy) you just add files to public_html and the rest of the you have to upload to new created folder.
     
  7. mjp

    mjp

    public_html is typically the home directory on a *nix/Apache server.

    At Everleap the site's home directory is: /site/wwwroot
     
    Ray Huang likes this.
  8. Thanks!
     

  9. mjp: Am I better off to create a subdomain under site/wwwroot, or adjacent to it.

    site/wwwroot/new subdomain name/wwwroot
    or
    site/new subdomain name/wwwroot

    I've been using the first option, but I struggle with site separation. I'm always questioning whether I'm reading support files (css, js, etc) from the main domain subfolders or the subdomain subfolders. I've been writing Blazor Server apps, and I'd like each app to behave like it's in its own space.
     
  10. travis

    travis Everleap staff

    All apps will be deployed to /site/wwwroot/ because it's the document root of the site. And any files outside that directory cannot be viewed in a browser.

    Means running multiple apps from a single site will always need to have inheritance and any possible routing conflicts taken into consideration. All apps could be run from separate subdirectories to isolate them that way, but then how an initial redirection might conflict with the app's internal routing would still be a possible concern.

    Otherwise the option would certainly be to use a multi-site account and host each app in a completely separate site.
     

Share This Page