Method for Handling Website Mirroring via Reverse Proxy

Published: 2016-01-14

If the website content accessed through the other party's domain is exactly the same as your own, or the content is roughly the same as your website,  if there is no actual harm, generally you do not need to make any adjustments.

This is because the other party has used a reverse proxy to scrape your website files and even cache them on the other party's server. You can find the other party's proxy server IP address and block it.

Example, your domain is www.abc.com, and the other party's website is www.abc.com.hdtmail.com

The following three methods are used to find the real IP of the other party's server. The premise is that the other party uses real-time proxying, rather than having cached your files on their own server and canceled the proxy.

1. Create a 123.php in the root directory, and write the following code


<?php

echo "REMOTE_ADDR:".$_SERVER["REMOTE_ADDR"]."</br>";

echo "HTTP_X_FORWARDED_FOR:".$_SERVER["HTTP_X_FORWARDED_FOR"]."</br>";

echo "HTTP_CLIENT_IP:".$_SERVER["HTTP_CLIENT_IP"]."</br>";

echo "HTTP_X_REAL_IP:".$_SERVER["HTTP_X_REAL_IP"]."</br>";

?>


Then visit http://www.abc.com.hdtmail.com/123.php 

The above four parameters are used to obtain the other party's server IP address,

The other party's server may use different proxy methods and different numbers of proxy layers, so it may be one of the obtained values.


It is possible that the file cannot be accessed by the first method. In that case, the other party has implemented some restriction measures. Try

2. Create 123.asp in your website root directory, and write the following code


<%

Response.write"REMOTE_ADDR:"&Request.ServerVariables("REMOTE_ADDR") &"</br>"

Response.write"HTTP_X_FORWARDED_FOR:"&Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"</br>"

Response.write"HTTP_CLIENT_IP:"&Request.ServerVariables("HTTP_CLIENT_IP") &"</br>"

Response.write"HTTP_X_REAL_IP:"&Request.ServerVariables("HTTP_X_REAL_IP") &"</br>"

%>


Then visit http://www.abc.com.hdtmail.com/123.asp

The above four parameters are used to obtain the other party's server IP address,

The other party's server may use different proxy methods and different numbers of proxy layers, so it may be one of the obtained values.


If the file cannot be accessed through either of the above two methods, it may be that the other party's server also checks and denies access to newly added files. You can directly modify an existing file.


3. Add the code from methods 1 and 2 to the first line of existing files such as index.php, index.asp

Then visit http://www.abc.com.hdtmail.com/index.asp

or http://www.abc.com.hdtmail.com/index.php

As in methods 1 and 2, obtain the other party's server IP address, then block it according to the following IP blocking tutorial


Virtual host IP blocking:   faq.myhostadmin.net/faq/listagent.asp?unid=681

VPS/server IP blocking: faq.myhostadmin.net/faq/listagent.asp?unid=822

After blocking the IP, visit the other party's domain again. If your website content can no longer be displayed, it means the blocking is working,

Delete 123.asp/123.php or the code you just added to your own file

But if the other party has already scraped pages and cached them on their server, they cannot be blocked; you can only consider changing your own website file names or appropriately revising the website content.