Multiple URL for one Drupal 8 website configuration
I've handled this situation very easily by setting two different Apache VirtualHost with the same DocumentRoot.

The thing you have to be very careful is the page caching of Drupal. I recommend you to read the Cache Context document on Drupal 8 who is very helpful for your situation. By passing the "url" cache context on your different render arrays, you will prevent the content of a URL to be displayed on the other.

Drupal routing system doesn't take the domain name. So there'll be no problem and a user who go on a subpage from a domain name will stay on this domain name.