The day before yesterday in Baidu search Wang Buiyuan blog site keyword, suddenly in the first page of Baidu results found a title, profile and I exactly the same site, do not see, this site is not the traditional sense of plagiarism, hotlinking, not only to copy all my site, And all the links in the Web page are replaced with that mirror Web site address.
I only then knew: my website was maliciously mirrored by others.
Malicious mirrors are dangerous.
Malicious mirror because of the copy of all the source station, if your site is not the weight of the bitter forced, silly Baidu if not clear which source station, it is difficult to copy you, if your weight but others. Regardless of your weight is not high, the site will undoubtedly weaken your weight, because Baidu spider found a lot and your site exactly the same content. Although there are many malicious mirrors on the Internet solution, but I feel that I encountered the situation and the Internet is not the same, the use of many methods on the Internet does not work.
Solution and Counter measures
After trying a number of ways to be ineffective, I came up with a stopgap measure: prohibit the malicious mirror site's access to IP, the reason is expedient, because the IP will not be able to change, and this IP is not a mirror URL of the resolution IP
Because of the many attempts to solve the problem, I found that the principle of this malicious mirror site is probably: when someone visits Abc.ytlqpo.com, it will visit (WWW) abc.com (cn\net\cc\xyz\wang), Then the results of the visit to modify the link back to you. So, it must have a process to access the source station. The solution, then, is to disable this access IP.
After searching for a huge amount of Web site log did not confirm this IP, I wrote a PHP file to intercept this access IP.
1. IP interception
Name the above file "ip.php" in the root directory of the site, and then I access wangbaiyuan.ytlqpo.com/ip.php through the mirror Web site, and then get this IP in the ip.txt generated by the PHP program above:
<?php
$file = "ip.txt";//saved filename
$ip = $_server[' remote_addr '];
$handle = fopen ($file, ' a ');
Fwrite ($handle, "IP address:");
Fwrite ($handle, "$ip");
Fwrite ($handle, "\ n");
Fclose ($handle);
? >
104.194.16.230 (USA)
2. Shielding IP
Add the following code to the htaccess:
Deny from 104.194.16.230
When you once again use the mirror website to visit your site will be reported 4.3 errors, now Baidu even included this site on your site will not have any impact
If your server is a Windows server is to block IP on it, if the site uses CDN need to let the CDN official technology to help you shield it.
3. Anti-system measures
To give this mirror site a small "counterattack", I decided to set this 403 error page as another Web site, the implementation of the htaccess code in the shielding IP to add:
ErrorDocument 403 http://news.baidu.com/
So when you visit your mirror site, you will find that it mirrors the fact that Baidu News. (Do not know Baidu Spider found a site in the total plagiarism of their own home things will be what feeling)
Of course, you can write your mirror web site to mirror other websites according to your personal needs, such as:
Use it to fanqiang!