Forum Moderators: mack

Message Too Old, No Replies

Direct Access IP can cause hijacking issue

         

3zero

2:36 pm on Jun 25, 2017 (gmt 0)



I found that one of my domains had disappeared on Bing

On further investigation I found another domain, I had never heard of was appearing instead with my content. It had replaced the original domain.

A quick whois lookup revealed just Privacy Protected, but the dns record showed the domain was pointing its A records to my ip

When I directly accessed the ip I found it displayed the same content as the original domain. (Not good)

So I added a small bit of php to the top of the domain to prevent direct access that I found online


$servername = $_SERVER['SERVER_NAME'];
if($servername == 'your-domain.com'){

}elseif($servername == 'your-domain-with-www.com'){

}else{
die("Direct ip access not allowed!");
}


Problem solved, but thought I'd share in case anyone else experiences this

There are a number of other options please see [serverfault.com...]

keyplyr

9:12 pm on Jun 25, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Good info 3zero, thanks for posting.

A Record hijacking... yet another, easily accomplished way of stealing your hard earned work. I've always wondered how some site owners who never bother to keep a diligent eye on their properties even survive in today's environment.

As a kid, my family never locked our front door, no need. Doubtful anyone does that today.