1

I have ASP.NET project(WebForms not MVC) to manage companies Project,Logs,ToDos, etc......

I want to allow user to access the site with url start with their company name. for example:

my site is www.mysite.com

i want to allow users to access my site like this

www.company1.mysite.com or www.company2.mysite.com or www.companyX.mysite.com

and then inside my code i could get the comanyX part.

can you give me any clues how to do this pragmatically or what steps i should do on my server or inside my code

not i'm using ASP.NET WebForms not MVC.

ebram khalil
  • 8,252
  • 7
  • 42
  • 60
  • What you want to achieve is called multi-tenancy. These might give intersting clues : http://stackoverflow.com/a/9566970/1236044 and http://stackoverflow.com/a/9047639/1236044 – jbl May 30 '13 at 11:42
  • @jbl can you give me clear steps of what i should do? and is there any changes i should make on the server or the DNS ? – ebram khalil May 30 '13 at 12:04

1 Answers1

1

First thing you have to do is set up a wildcard DNS entry *.mysite.com see ( http://en.wikipedia.org/wiki/Wildcard_DNS_record ) so that any url ending with .mysite.com end up on your server.

Then, you have several options, two of these are :

Community
  • 1
  • 1
jbl
  • 15,179
  • 3
  • 34
  • 101