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\'
if you want to handle in code then do it in Global.asax in BeginRequest as below
void Application_BeginRequest(object sender, EventArgs e)
{
if (!context.Request.Url.Host.ToLower().Equals("www.mydomain.com"))
{
context.Rewritepath("/invalidpage.aspx");
}
}
The other simple way is to specify a host headers in IIS for your website.
http://technet.microsoft.com/en-us/library/cc753195(v=ws.10).aspx Note: I am writing through my mobile so consider spelling mistakes