This is not done by the router it is done by the web server itself. You must use a single machine to host both sites...it is technically possible to use multiple but the first machine must still take the traffic.
To make this work you must have multiple domains registered to the same address. so if I have site1.com and site2.com both registered to 123.123.123.123. The traffic will come to 123.123.123.123 and be port forwarded to your server say 192.168.0.10. Now inside the actually HTTP headers you will actually see the site1.com or site2.com data strings that the user passes. Most web servers already know how to do this you just need to configure it to work it is not something you have to code yourself. Follow the...