Re: Redirecting after changing server's IP address!

From: Date: Wed, 27 Nov 2002 14:26:42 +0000
Subject: Re: Redirecting after changing server's IP address!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-126282@lists.php.net to get a copy of this message
Is the connection still valid after changing the IP? I think this should work: You should run your perl script from within shutdown function, so it is run after the connection is closed and any output is sent to the browser. Send header('Refresh: 5; url=http://NEW_IP/next_page.php'); to redirect the browser after five seconds, also print some html informing the user he will be redirected, then exit. Your shutdown function will be called, and you can change the ip Adharsh Praveen R wrote:
hai php-general, I want to know how can I redirect the browser to contact to a new ip address of the same server. In Detail I have a server say 192.168.1.10 (eth0) running apache.( Linux Machine running Apache). I contact the server through a client(Browser), through this client I change the IP address of the server, from 192.168.1.10 to 192.168.1.15. (After entering IP Address in the text field and clicking on the button save I call a perl script which calls ifconfig to change the address,perl script is called with exec() ). After few seconds I get "Page cannot be found" message as the browser tries to contact the old IP address. How can I make the client point to the new IP address of the same server? I can show the code also. Please help. regards, adharsh.


« previous php.general (#126282) next »