The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    DNS Help

    Discussion in 'Networking and Wireless' started by nquach, Apr 6, 2007.

  1. nquach

    nquach Notebook Consultant

    Reputations:
    2
    Messages:
    172
    Likes Received:
    0
    Trophy Points:
    30
    Does anyone know how to redirect traffic from a main website to a subdomain website transparently? For example, www.johndoe.com to johndoe.domain.com.
    The URL should still read johndoe.com.
     
  2. tpoynton

    tpoynton Notebook Geek

    Reputations:
    44
    Messages:
    82
    Likes Received:
    0
    Trophy Points:
    15
    I dont know what you mean by transparently...perhaps 'masking'? Masking is generally frowned upon.

    You can use htaccess and/or php to do redirects. I suspect you will want to use htaccess, but I'm no expert at writing the code.
     
  3. plasticbug

    plasticbug Newbie

    Reputations:
    0
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    5
    Maybe something like this?

    PHP:
    <frameset rows="100%,*" border='0' frameborder='0'>
    <
    frame name="_main" src="http://johndoe.domain.com/" noresize frameborder='0'>
    </
    frameset>
    Copy and paste the above code, name it index.html/php/asp/htm and put it in the root/www/htdocs directory.
     
    Last edited by a moderator: May 6, 2015
  4. nquach

    nquach Notebook Consultant

    Reputations:
    2
    Messages:
    172
    Likes Received:
    0
    Trophy Points:
    30
    Let's try a different approach.

    I want to build a new web site for my homepage. I'm putting it in a subdirectory off the root directory of the main website (ex. johndoe.com/newsite/). Upon completion, how do I set newsite to be the new main page without disturbing the old. I don't want to move the content of the directory because that might break some of the scripts.

    I've looked into .htaccess and DNS CNAMES but don't know which is more appropriate.
     
  5. blue68f100

    blue68f100 Notebook Virtuoso

    Reputations:
    1,020
    Messages:
    3,439
    Likes Received:
    0
    Trophy Points:
    105
    If your domain is registered, just change the settings that are registered. Or if your using a DNS service, change in there. I know DynDNS supports this.

    Or just change the index to point to your new page.
     
  6. plasticbug

    plasticbug Newbie

    Reputations:
    0
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    5
    If you're using Linux and cPanel, it can be easily done by creating a subdomain, say newsite.johndoe.com that is pointed to johndoe.com/newsite. cPanel will then automatically create the CNAME entry in the server's DNS. If your account supports multiple domains, the same above is applied but for a new domain name, newdomain.com pointed to johndoe.com/newsite. You must be using your web host's DNS servers for this to be done.