I don't really understand all that, but my position is that is it deceitful and dishonest to pretend to a user that he is visiting a certain web page when in reality he is visiting another. I can think of no situation where that is proper or legitimate, and as I see it that is a technique of phishers and other criminals. That is not at all the same as having multiple domains point to one IP address. I don't think that sort of thing ought to be encouraged in this forum.
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.