开发者

ASP.NET Routing (3.5) - How to handle multiple TLD domains?

Is it possible to have one asp.net web application that handles requests from two domains via asp.net routing? I need one TLD domain per language version pointin开发者_如何学编程g to the same app.

  1. How to set up a route that recognize, if the request is coming from domain1.de or domain2.com?
  2. How to configure the domains DNS for this to work?

Thanks in advance!


Something like this has been asked before: Is it possible to make an ASP.NET MVC route based on a subdomain?

For your questions:

  1. Your solution would be very similar, just change up the string parsing however you want.
  2. The DNS would be simple, just point all the domains to the same IP (your web server's of course). In IIS if you're hosting one site, simply don't configure host headers on the site at all. If you're using multiple sites, then you'll need to add a host header check for every possible domain...so that IIS correctly routes the request into your app.

If you need more info on host headers, add a comment to this and I can explain further...otherwise explaining other scenarios and such just serves to confuse something that should be simple.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜