0

My team is creating a project that allows different users to use the web application based on different sub-domain. That is to say. http://P1.example.com will has its own set of P1's user and http://P2.example.com will has its own set of P2's user.

We do not have the structural issues with the database and the code but we have questions regarding the project's setup. I have read similar questions and answers here but they are not leading me to the right direction: Add subdomain to localhost URL and Apache vhost not working for subdomains as they are not windows-based.

Question:

  1. How do I setup such that I can test subdomains on visual studio on localhost settings. What are the setup we need to do?

  2. What should I do to trick the computer and tell it to "redirect" the requests all P1.localhost to localhost and P2.localhost to localhost but maintaining the URL in the browser?

Community
  • 1
  • 1
Guo Hong Lim
  • 1,690
  • 3
  • 13
  • 20

1 Answers1

1

You can set up a normal site in IIS and assign it a binding of subdomain.localhost

Then in your hosts file (c:\windows\system32\drivers\etc\hosts) add an entry

127.0.0.1     subdomain.localhost

Sorry for this being quite short, I assume that you already know how to set up a site in IIS.

D3vy
  • 831
  • 7
  • 19