Forum Moderators: phranque

Message Too Old, No Replies

Redirect Domain to Subdomain

I have a domain and subdomain and want to redirect it

         

Karan13

3:08 pm on Aug 10, 2005 (gmt 0)

10+ Year Member



I am doing some work on my website, and although it is small i just want to try and do it without interruptions as i am updating all the pages. So my first thought was to create a subdomain and then just move all the files in there, and have the domain, www.example.com point to foo.example.com

However is it possible through .htaccess that it will still show in the browser www.example.com even though it is a subdomain. So if i go to www.example.com/files/index.html it will point to foo.example.com/files/index.html but i would like the browser address bar to still say www.example.com/files/index.html

I know it sounds wierd, but i am just trying to learn. Does anyone suggest anything else. Any other way to do updates on a site. Please let me know what you guys do.

jdMorgan

4:10 pm on Aug 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> However is it possible through .htaccess that it will still show in the browser www.example.com even though it is a subdomain.

This is true if you use a redirect. Instead, use a server-internal rewrite. In this way, the browser is not informed of any change to the URL; Only the server knows that it is delivering content from a different filepath than that which the URL implies.

Try this search [google.com] to find lots of information about mapping subdomains to subdirectories that has been posted here on WebmasterWorld.

Jim