I have a ASP.Net MVC application which serves user pages with URL like –
http://www.myapp.com/user/rob/index,
http://www.myapp.com/user/rob/article/1
and
http://www.myapp.com/user/scott/index,
http://www.myapp.com/user/scott/article/1
now I want this one application to serve pages to two different domains from outside. Like –
http://www.RobWebSite.com/Index
http://www.RobWebSite.com/article/1
http://www.scottBlogSiteNoOne.com/Index
http://www.ScottBlogSiteNoOne.com/article/1
what kind of setup / redirects / proxies I will need to setup so when user types the published domain name (www.RobWebSite.com) it translates internally to my app as (www.myapp.com/user/rob/). I want to keep the url in the browser the same what they typed, while just query string parameters changes.
Thanks and Regards,
Ajay
Each users’ domain name will need a CNAME record in their DNS that points to myapp.com. (Google uses CNAME records to point custom domain names to Blogger.com blogs, so that seems like a good way to go.)
Then your code needs to look at the Request object to identify which domain name is being used and do a lookup to find which user the domain belongs to. This wouldn’t really be translating to myapp.com/user/name/. It would be using the domain name to determine the user instead of the route parsing that you would normally do with MVC.
I’m not 100% sure that the Request object will give you the right domain name. You’ll have to try it out.