title: Wordpress + .htaccess redirect based on domain
body: <p>I have 2 servers on digital ocean (Love them!), a varnish cache, and a wordpress backend. 
  <code>http://domain.com</code> is set to the varnish cache. <code>server1.domain.com</code> is set to the second server as a backend, so I can have direct access without hitting the cache. </p>
  
  <p>I've set wordpress to use both domains any <code>$_SERVER['hostname']</code>. Loading <code>Server1.domain.com</code> works fine, all links go to <code>server1.domain.com</code>, but many files and stylesheets still say <code>domain.com</code></p>
  
  <p>It it possible to use a rewrite condition to look at the hostname, and if its <code>server1.domain.com</code>, and if so, redirect all <code>domain.com</code> to <code>server1.domain.com</code>?</p>
  
  <p>I've seen redirects for <code>www</code> to <code>domain.com</code>, but I'm only looking to do this if the hostname is <code>server1.domain.com</code></p>