Forum Moderators: phranque

Message Too Old, No Replies

help with rewrite. please.

         

keentolearn

3:31 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



hi all

i am sure this is simple but i cant seem to find the answer.

i want to change the address in the browser for a website that isnt yet on its webspace

so the site address is www.newsite.com

but for the time being the site is still at www.oldsitec.com/test/

i was thinking about using a 301 redirect ( in the newsite.com )to forward users to the oldside.com/test/ folder - that bit i am ok on

but then i want to change the address in the browser address bar to show the domain to be www.newsite.com

can you any one help me with this?

many thanks

as ever
keen to learn..

jdMorgan

4:23 pm on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With a redirect, the server sends a message to the client (browser) to tell it to ask again for what it wanted, but using a new URL. It is the browser issuing this second request that updates the address bar, and you cannot control that.

If you wish to forward requests 'silently' to another domain, set up a reverse proxy on the newsite.com server. Be aware that all requests proxied to oldsite.com will pass through newsite.com's server, and that the server logs and stats on oldsite.com will always show newsite.com as the IP address making all of those requests, unless you set up newsite.com to send the X-HTTP-FORWARDED-FOR header, and set up oldsite.com to log that header instead of (or in addition to) the REMOTE_ADDR header. Otherwise, your logs and stats on oldsite.com will be useless.

Also, all of the above requires server configuration-file access permissions; You won't be able to do this unless the sites are hosted on a dedicated server or virtual private server.

As you can probably tell by now, this is not a simple, easy project...

Jim

keentolearn

6:13 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



hi jdMorgan

many thanks for the explanation- as you say not simple

thanks again
keen to learn..