jonbad

Chinese sites stealing my IP address

Recommended Posts

I have a few sites from China that must have their DNS pointing to my site’s IP address. If you enter their domain into the address bar of a browser, you get my site but their domain in the address bar. I’m not sure what their purpose of doing this is, but they have three of the top four search results when I search for my site on Google. Frustrating.

Using the .htaccess file I’ve put in a rewrite condition and rule so if the incoming domain is NOT mine it will basically refresh to my domain.

RewriteCond %{HTTP_HOST} !^(www\.)?myDomainName\.com$ [NC]

RewriteRule (.*) http://www. myDomainName.com/$1 [R=301,L]

But I don’t want to do this. I’d rather have anyone coming from those Chinese sites get a 404 Not Found message. I don’t really want to use a custom 404 page because – if I have this correct – they will still get to my site for the custom 404 page to be shown. I don’t want them on my site at all – I just want them to get the browser’s 404 message like the site does not exist.

So, my question is what is the syntax for the RewriteRule to do this? Something like RewriteRule (.*) 404/$1 [R=301,L] ?

I’ve searched Google, but haven’t come up with anything definite, so I really could use some help.

Thank you for your help.

Share this post


Link to post
Share on other sites

That could be a mistake, you could contact the hosting company that has the domains. 

 

To stop that access to your site,  and to prevent your site from being a training ground for chinese hackers, simply block all chinese IP addresses using htaccess.  The lists are available online.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now