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.
-
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. -
Maybe something like this?
Copy and paste the above code, name it index.html/php/asp/htm and put it in the root/www/htdocs directory.PHP:<frameset rows="100%,*" border='0' frameborder='0'>
<frame name="_main" src="http://johndoe.domain.com/" noresize frameborder='0'>
</frameset>Last edited by a moderator: May 6, 2015 -
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. -
blue68f100 Notebook Virtuoso
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. -
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.
DNS Help
Discussion in 'Networking and Wireless' started by nquach, Apr 6, 2007.