mod_rewrite and redirects for seamless server change

Discussion in 'Apache' started by oneawesomeguy, Apr 20, 2010.

  1. #1
    I want to do a server change without any downtime and think the best way of doing it is with two .htaccess files.

    I was thinking of doing a temp redirect from the domain name to 222.222.222.222 (new IP) to redirect users to the new server (this .htaccess file is located on the old server). Then on the new server, I would do a mod_rewrite and rewrite 222.222.222.222 to the domain name. All of this is happening while the DNS records are propagating and would lead to a transfer with absolutely zero downtime.

    Can anyone tell me if this would work or how I would write these two .htaccess files? Thanks!

    EDIT: It seems like this solution, in theory, would be great for regular website files, but would not work correctly with MySQL databases or email files stored on the server. Either way, I think it is still a great solution if anyone know how to get it to function correctly.
     
    oneawesomeguy, Apr 20, 2010 IP