The source code of the copy is nearly identical to the site which you own. I suspect this is a Proxy version, so that any requests to the copy site are echoed to the legitimate site. The Proxy would be using simple substitution so from your server point of view, the Host
header would be correct. When you server responds, substitution is again used so that the browser will see hyperlinks that remain within the copy domain, so that the Proxy server retains control of the traffic.
I've seen substitution of phone numbers before, (masquerading as a legitimate call analytics service) which is rather concerning, as they could log calls with such a trick.
If my assumptions are correct, then here is the long-term solution:
Look at the WHOIS of the copy's domain, and of the IP address on which that domain is hosted. Determine the company responsible.
Contact the company that runs the copy, and ask them to stop.
If they do not cooperate, it may also be prudent to check if anyone on your end has signed up or paid for a 'service' that might be doing this.
If all above solutions fail, contact the ISP on copyright grounds to ask for the content to be removed. (You can ask a separate question on how to format such a request.)
Unfortunately, the above solution is beyond your control and may not always work.
Technically you have a couple options:
If you can tell which IP address the Proxy Server is using to retrieve content from your equipment, then you could block that IP.
Unfortunately the IP address may rotate, so this might require frequent updates.
Detecting changing IPs could be automated with a script, but if they catch on to this they might have a workaround.
Include a JavaScript safeguard, that ensures location.host
is equal to the desired host name before making content visible. Ensure content is hidden by default until this JavaScript is successful. If the JavaScript detects a mis-match then redirect the user to the legitimate site which you own.
Use code such as if(location.host != 'examp'+'le.com')
, breaking up the actual hostname with '+'
so their substitution will not 'auto-correct' your code. :-)
Unfortunately if they catch on to this they might try to strip your script to allow the content to go through.