Well if you are using a plain php site then it would become some work but I can think of two ways,
In either cases you need a function that generates those domains dynamically
<?php
getDomain(){
$domains = array('example.com','example2.com', 'example3.com');
return $domains[mt_rand(0,count($domains)-1)];
}
?>
-
Either create all links on the page as relative links then add a base tag on the top of the page which is generated dynamically.
<head><base href="<?= getDomain() ?>"></head>
This way all relative links will be written relative to that base, this is the easier method but it's not really what I would recommend.
-
Second method I would suggest is creating a function that creates all the links, or handle it manually if you don't want to create an extra function, for example:
Instead of doing this
<a href = 'http://mydomain.com/some/uri'>Go here</a>
You would write it something like this
<a href = '<?= getDomain() ?>/some/uri'>Go here</a>
Or create a URL generating function
<?php
generateLink($uri){
return getDomain().$uri;
}
?>
Then call it like this
<a href = '<?= generateLink('/some/uri') ?>'>Go here</a>
Keep in mind that not all links on the same page would have the same domain, you need to handle that your self if you want all links to point to the same domain in each request.
Of course the whole thing is just messy, but then the feature it self is strange so I don't expect any thing much cleaner to do this.