It works!!! I can’t thank you enough. It feels really good to develop something from scratch like this, even if I did need a ton of help. This will solve a lot of headaches for me down the road, and hopefully it will make the switching back and forth of URLs even more transparent to the user.
My end result is exactly like yours, except without the array:
$uri = $_SERVER['REQUEST_URI'];
$url = 'http://www.example1.com/' . $uri;
$modx->sendRedirect($url);
Thanks again. I’m new to this sort of original creation, but is this something that should go in the repository or the wiki, or do you think it’s too specific to be of much use to anyone else?