Domain and subdomain site in asp.net
i am developing a开发者_如何学Python site which demo URL is http://www.abc.com now my client wants all member pages open in a new URL like http://members.abc.com and this site is design and developed in ASP.Net with C#. I am too confused that how we can do this? I want to maintain login status on both domains. How to manage this functionality?
To create the duplicate site you would need to create a new DNS A record and then set up the site in IIS. If the sites will always be exact duplicates running the same web application then you could create a CNAME record which would make members.abc.com
an alias of www.abc.com
.
To share the cookie between the two subdomains you explicitly set the cookie domain to abc.com
.
HttpCookie cookie = new HttpCookie("foo", "bar");
cookie.Domain = "abc.com";
精彩评论