a client asked me today about having users be able to have their own domains within the web application.
example would be:
http://example.com/User/View.aspx?=60 would change into http://userpage.com/
I am not sure how to approach this, can any开发者_高级运维one provide me few pointers?
Here is complete documentation from Microsoft on how to use multiple host headers. Essentially, you configure the web server (IIS) with multiple web sites, then within each website you configure the list of host headers that the site should respond to. This allows you to host multiple sites on the same server:
http://support.microsoft.com/kb/190008 (or similar articles for other versions, such as http://technet.microsoft.com/en-us/library/cc753195%28WS.10%29.aspx or http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/e7a21b1f-ab13-47f2-8c61-b09cf14a7cb3.mspx?mfr=true)
Provided they have the domain and it is on a client's server, you can forward based on the id presented (60).
If http://userpage.webapp.com, you can use routing rules in ASP.NET 4.0 to handle this (some functionality in 3.5, I think, but 4.0 is better).
精彩评论