如何从指着我的域名停止其他领域? [英] How do I stop other domains from pointing to my domain?

查看:102
本文介绍了如何从指着我的域名停止其他领域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近发现有指着我的网站(即不属于我)其他域名,我想知道人们怎么可以阻止/ prevent这种情况的发生。我使用的是IIS上peer1的托管这一点,我使用ASP.NET C#。

I recently found out that there are other domain names pointing to my website (that don't belong to me) and I was wondering how people can stop/prevent this from happening. I'm hosting this on peer1 using IIS and I'm using ASP.NET C#.

我可以使用一个HttpModule或其他一些code拒绝域名不属于我的?

Can I use an HttpModule or some other code to reject domain names that aren't mine?

有没有更好的办法?

推荐答案

您应该激活基于域名的虚拟主机,只显示你真正的网站所需的域名。对于所有其他名称,则可以显示相应的错误信息。

You should activate name-based virtual hosting and only show your real website for the desired domain names. For all other names, you can display a suitable error message.

详细内容:您的网络服务器通过IP地址联系。没有什么可以做,以制止。任何人都可以说,连接到该IP地址。例如,任何人都可以注册新的域名指向您的服务器的IP地址。但是,请求里面,有一个字段主机 www.example.com 的名称。

Details: Your webserver is contacted by its IP address. There is nothing you can do to stop that. Anyone can say, "connect to that IP address". For instance, anyone can register new domain names to point to your server's IP address. However, inside the request, there is a field Host with a name like www.example.com.

在收到请求时,服务器可能会选择检查主机字段,并提供取决于值不同的内容。在最简单的情况下,服务器将忽略完全实地和总是打印出相同的内容。但是,在一个更​​复杂的设置,所谓的基于名称(虚拟)托管,这取决于主机服务器选择的内容。

Upon receiving the request, your server may choose to inspect the Host field and deliver different content depending on that value. In the simplest case, the server ignores the field entirely and always prints out the same content. But in a more sophisticated set-up, so called "name-based (virtual) hosting", the server chooses the content depending on the hostname.

这是怎么主机管理共享的工作:有一台服务器,但根据所请求的主机就吐出不同的网站,每个名称

This is how shared webhosts work: There's a single server, but depending on the requested hostname it spits out a different website for each name.

因此​​,如果您希望您的服务器内容系在你的主机名,你要告诉你的服务器来产生你的网站只为你想要的名称,并产生对所有其他案件不同的(错误)的网站。

Therefore, if you want to tie your server content to your hostname, you have to tell your server to produce your website only for your desired name, and to produce a different (error) website for all other cases.

在Apache的,这是微不足道的配置,只检查他们的文档;对于IIS我不知道,但我想它也同样简单。

In Apache this is trivial to configure, just check their documentation; for IIS I wouldn't know but I imagine it's equally simple.

这篇关于如何从指着我的域名停止其他领域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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