multiple domain url routing in asp.net 4
Can Asp.Net 4 Webforms handle url routing for differing domain names?
Ex. www.abc.com www.admin.abc.com www.domainname.com www.admin.domainname.com
I would like to ma开发者_StackOverflowke a single app to handle the requests coming from the above URLs. Most of the scenarios I have found point to having url routing based on a single domain and multiple web pages.
Thanks!
Yes it can (If I understand your using of the word URL Routing correctly).
Simply set a host-header entry for the application for each of the domains you want to support. You can do this in the IIS.
As a result www.abc.com www.admin.abc.com www.domainname.com www.admin.domainname.com all point to the same web application. Be aware, that sharing a session between multiple domain names might become a problem. (If the user starts surfing with www.abc.com and later uses www.domainname.com)
Another approach would be to use the canonical hostname rule for the IIS 7.5 URL Rewrite 2 Module. That results in having only domain that is visible for the users. E.g. www.domainname.com/myFooPage gets redirected to www.abc.com/myFooPage)
This might be a good approach for SEO
精彩评论