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