I am running a site for a German NGO under the domain
Recently, I added
sub.example.ch for its Swiss spin-off.
Both (sub-)domains are pointing to the same physical location, a WP install (not multisite).
I have it setup such that
sub.example.ch/register, for instance, will correctly show the content found under
However, when a Swiss visitor surfs the site using regular on-site links, he or she will inevitably end up on the "regular" domain, since those utilize the "WordPress address" (or "site address") as defined in general settings, either via
get_site_url() (or their less-deep
Ideally, I'd like the visitor to keep surfing under the domain that he or she used to reach the site. Hence, I suppose I'd have to somehow filter the return value of the mentioned functions. A filter, which, as far as I know, does not exist.
Does anybody have experience with this sort of thing and a decent solution handy?
Is this maybe a dumb idea and I should let it go in the first place?