More then one site on a hosting plan?

Discussion in 'Site Programming, Development and Design' started by Firefly Beach, Mar 7, 2010.

  1. How do i have more then 1 website on a hosting plan using different domain names?
     
  2. curtis

    curtis Winhost Staff

    Add a domain pointer using your Site Manager. Then you can programically redirect that domain to subfolder.
     
  3. I've added the domain pointer, what would my next step be?
     
  4. Ray

    Ray

    Then you need to create a subfolder under your root via FTP, and upload your second site there.

    Use a redirect script so that the domain pointer is redirected to the subfolder.
     
  5. i've created the sub folder, but i'm not sure how to make the redirect script.
    Also, i don't have the domain on this host, what info do i need to link the domain to this sub folder?
     
  6. i've had a look at the example in the knowledge base. but i'm a little lost as to how to use it.

    <%
    If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain1.HostingAccountDomain.com") ) > 0 Then
    Response.Redirect("/subdomain1")
    ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain2.HostingAccountDomain.com") ) > 0 Then
    Response.Redirect("/subdomain2")
    ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("subdomain3.HostingAccountDomain.com") ) > 0 Then
    Response.Redirect("/subdomain3/home.asp")
    End If
    %>

    Where should i be putting this in my asp.net site?
    I know what to change "subdomain1.HostingAccountDomain.com" and "/subdomain1" but what do i change "SERVER_NAME" to?
     
  7. Ray

    Ray

    The redirect script is actually setup at the top of your startup page on the root.

    "SERVER_NAME" should remain the same.
     
  8. I have been trying to get this one as well

    here is the code I put at the top of index page of root
    <%
    If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("liquidsoulsessence.hereiamlive.com") ) > 0 Then
    Response.Redirect("http://liquidsoulsessence.com")
    End If
    %>

    but it does not work
     
  9. also tried this:

    <%
    If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("liquidsoulsessence.hereiamlive.com") ) > 0 Then
    Response.Redirect("/liquidsoulsessence")
    End If
    %>
     
  10. Ray

    Ray

    Are you sure its not working? Base off this telnet test it shows that it is being redirected.

    GET / HTTP/1.1
    HOST: liquidsoulsessence.hereiamlive.comHTTP/1.1 302 Found
    Cache-Control: private
    Content-Type: text/html; charset=utf-8
    Location: /liquidsoulsessence
    Server: Microsoft-IIS/7.0
    X-AspNet-Version: 2.0.50727
    X-Powered-By: ASP.NET
    Date: Wed, 07 Jul 2010 23:14:36 GMT
    Connection: close
    Content-Length: 138

    <html><head><title>Object moved</title></head><body>
    <h2>Object moved to <a href="%2fliquidsoulsessence">here</a>.</h2>
    </body></html>


    Connection to host lost.

    C:\>
     
  11. OK ... I got it

    while writing that last post
    It came to me to simply put liquidsoulsessence.com
    instead of liquidsoulsessence.hereiamlive.com
    and it is all good now

    Thanks for your help
     
  12. i still haven't got this to work yet.

    This is my whole index.html page, is this correct?

    <%
    If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("dirtycityhearts.com") ) > 0 Then
    Response.Redirect("/DirtyCityHearts")
    End If
    %>

    <html>

    <header>
    <title>Firefly Beach Design Group</title>
    </header>

    <body>
    <img src="Firefly-Logo-3.png" alt="Coming Soon" />

    </body>
    </html>
     
  13. Ray

    Ray

    Try changing your file name from index.html to index.asp.
     
  14. Ray

    Ray

  15. I will create a new thread later. I finally got a set of rules that will handle everything properly including ajax.
     
  16. Thanks so much, cant wait to see it :)
     
  17. Last edited by a moderator: Oct 14, 2015

Share This Page