This is easy to do, but not with Angular (or any other JavaScript router, for that matter). Routing to a subdomain requires a server for assistance. You need to configure user1
and user2
as subdomains, and then into your default document - based on what you are doing.
Then the Angular application will be hosted at one of the addresses, so it will be http://user1.example.com/index.html , and the other will be http://user2.example.com . This may be the same application.
To solve all- Angular, you just have to change your schema to use http://example.com/user1 .
There is another reason why the latest URL scheme might be better for you. If you are the host, you can create subdomains for your heart content. If, however, you use shared hosting, there is a rather high probability that you are limited by the number of subdomains that you can use - this can be just two.
source share