There are several ways to this, you can either use DNS, such as a Cisco Distributed Director, that will act as the nameserver for your site, if it cannot contact your primary site it will redirect to your secondary site.
You can just use a load balancer, this will direct users to one of your backend sites, this can either be a device or a simple linux server running something like keepalived
However in both cases its an external system that could fail.
You will also have to ensure that your two systems are kept up to date, something like rsync.
You may consider putting your secondary site in a cloud such as Amazon