I'm working on a site where I need to add a 'maintenance mode' and became curious to see what methods people use to deploy their sites to live, when there is a required downtime.Some ideas that come to my mind are symlinked folder switching, .htaccess redirects or even some sort of switch in the application but what do you use and why?
Deploying websites with a 'Maintenance Mode' switch
site deployment;site maintenance
I recommend using .htaccess redirect for several reasons:you can activate/deactivate it by just renaming the file, which is very easy and fastyou can do temporary redirects (302), which is good for seoyou can let several test/dev IPs see the real stuff while all other users see the maintenance page (so you can test the new features before going back live)it's very easy to set this up