我想在单个发布directroy中使用多个域。 [英] I want to use multiple domain in single publish directroy.

查看:67
本文介绍了我想在单个发布directroy中使用多个域。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个网站,如 www.abc.com ,我想为这个网站增加一个域名比如,爱尔兰的 www.abc.ie



我想在IIS服务器中使用相同的发布目录并使用不同的ip绑定ip它不重要。



如果有任何方法可以在IIS 8中添加任何规则或更改web.config文件替换根URL运行时我也创建url在web.config中重写规则。



请建议我如何实现这个目标。



我正在使用ASP.Net 4.5与C#



我尝试过:



i我试图找出方法...

解决方案

除非你想做类似的事情,否则IP地址会有所不同, www.abc.com / ir / ,因为如果您要映射URL,那么要连接的域的IP地址仍然是相同的,但是要查找数据的目录(或者co ntroller来映射)会有所不同。在许多方面,如果您的企业是初创公司或小型企业,我不建议为各个国家/地区使用不同的IP地址(或域名)。



而是使用URL映射,然后根据用户的区域设置呈现数据。这将简单得多,并且不会为雇用开发团队和服务器管理人员花费大量资金。



这是我个人对你的推荐,如果你不感兴趣,那么你应该考虑阅读主机阅读器。在IIS中,您可以配置为在同一服务器下提供两个不同的域名。如果您阅读此答案,请 c# - MVC:如何从一个站点正确提供多个域名(每个站点的内容不同) - Stack Overflow [ ^ ],你会发现你可以服务多个通过单个网站的网络域名。有关正确绑定它们的更多信息,请为网站配置主机标头(IIS 7) [ ^ ]



如果仍需要一些解释,请参阅以下内容以了解如何应用主机阅读器来服务多个Web域。 />


ASP。 NET MVC域路由 [ ^ ]

单个asp.net mvc应用程序中的多个域名| ASP.NET论坛 [ ^ ]

Hello,

I have one website like, www.abc.com and i want to add one more domain for this website like, www.abc.ie for ireland.

I want to use same publish directory in IIS server and bind with different ip or same ip its dosen't matter.

If have any way to add any rules in IIS 8 OR change in web.config file replace root url runtime and i am also create url rewrite rules in web.config.

Please suggest how i achieved this.

I am using ASP.Net 4.5 with C#

What I have tried:

i am trying to find out way...

解决方案

The IP addresses would be different, unless you want to do something like, "www.abc.com/ir/", because if you are mapping the URLs then the IP address for the domain to be connected to, would still be the same but the directory to look for data (or the controller to map) would be different. In many ways, if your business is a startup or a small business, I won't recommend having a different IP address (or domain) for countries.

Instead, use the URL mapping, then render the data based on the locale of the users. That would be much simpler and won't cost you a lot of money for hiring development teams and server management personnel.

That was my personal recommendation for you, if you're not interested, then you should consider reading about "host reader". In IIS you can configure to serve two different domain names under the same server. If you read this answer, c# - MVC: how to correctly serve multiple domain names from one site (different content for each) - Stack Overflow[^], you will find that you can serve multiple web domains through a single web site. For more on binding them correctly, Configure a Host Header for a Web Site (IIS 7)[^]

If that still requires a bit explanation, please refer to the following ones to learn how to apply "host readers" to serve multiple web domains.

ASP.NET MVC Domain Routing[^]
Multiple domains in single asp.net mvc application | The ASP.NET Forums[^]


这篇关于我想在单个发布directroy中使用多个域。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆