I have created a PHP website. I already have a shared hosting and bought a new VPS. Now I want to launch my website from my new VPS, but I want to keep a mirror running on my shared hosting and in case if my VPS goes down, I want the traffic to be diverted to my shared hosting for the time being. I am totally new to this and have no idea how can I do this and dont know if this should be posted on Server fault or here.
I tried to google about this, but I am not able to find anything like this. Please help.
Thanks in advance.
I think you are looking for a load balancer or proxy which can route your request to a different node when one node goes down. Basically your DNS entries will point to the proxy, which will transparently forward requests to the correct node.
There are some turn-key load balancers out there which are really simple to set up. Rackspace Cloud Load Balancers are the first that come to mind.