Dynamic subdomains

Discussion in 'Site Programming, Development and Design' started by cpbrand, Dec 6, 2010.

  1. Hi

    I want to be able to route (redirect then rewrite) requests from subdomain.domain.com to domain.com/defaultpage.aspx?sd=subdomain, then rewrite as subdomain.domain.com.

    I have the Winhost max plan, no SSL certificate.

    I've added the DNS entry (A) for *.domain.com

    Also added the following redirect rule with IIS 7 URL Rewrite tool:

    <rule name="test sd" enabled="true" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTP_HOST}" pattern="^(^.*)\.domain\.com$" />
    </conditions>
    <action type="Redirect" url="http://domain.com/defaultpage.aspx?sd={C:1}" />
    </rule>

    This works only if there is an actual physical sub domain created in Winhost CPanel.

    When I test it with any sub domain (non-existent) I get a page with the following message:


    Web Page is Unavailable
    We are very sorry.
    The web page you are trying to reach is unavailable.
    Please contact the Website Administrator.
    We apologize for the inconvenience.

    When there is no *.domain.com A record in DNS there is a Server not found error when trying to access a non existing (dynamic) sub domain.

    Would a SSL certificate resolve this? Please advise.
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    You need to order the SSL certificate and install it on the server so you can get a unique IP address. Once you have a unique IP address you can go into your Domain Manager and type an A record of *.domain.com.
     
  3. Thanks for the reply - Would RapidSSL be sufficient?
     
  4. Ray

    Ray

    Yes, any SSL should work as long as it is a valid SSL. Winhost can't support temporary or test SSL certificates for obvious reasons, but I believe Rapid SSL offers a free SSL certificate or a very inexpensive SSL certificate. This should work on Winhost servers. But remember, a Winhost account needs to be on the Max or Ultimate plan to be able to carry a SSL certificate. If you are on the Basic plan you will need to upsize.
     
    Last edited by a moderator: Oct 14, 2015
  5. Ordered & installed RapidSSL, also decided to use MVC 2 - solution working now! Thanks for the help, much appreciated :D
     

Share This Page