How do I stop other domains from pointing to my domain?

前端 未结 7 762
深忆病人
深忆病人 2021-02-08 12:58

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\'

7条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 13:29

    In IIS there is a setting called bindings that allows you to select which hostnames your website will respond to. This feature allows an instance of IIS to host mulitple websites on a single IP address.

    If you want your site to only work for http://example.com/ and http://www.example.com/, you should set the bindings to only work for "example.com" and "www.example.com".

    The exception here is if you are using SSL. If you are, IIS cannot determine the hostname and you will most likely have to use a dedicated IP address for your site. In that scenario, user608576's solution will work. Although, I would put that code in your Global.asax file:

    <%@ Application Language="C#" %>
    
    

提交回复
热议问题