Seems someone has set their domain to use my server. It's not a mirror, the database and everything works and updates with mine. He's basically stealing my content, and he's showing up on google instead of me.

Is there a way to make it so my server will only respond to requests from my domain?

I'm using Wordpress with Apache2. Block IP with .htaccess not works


You need to set your server restriction to localhost only. Any Adminpanel/Cpanel should have a button like "allow connection from external server". If you only allow connections from your localhost/webspace he won't be able to connect to your database. However, you should immediately change your database password. Change it in e.g. PHP myadmin as well as in the wp-config.php (root folder). Please consider installing a firewall like Wordfence.

  • Thanks I will try wordfence, Currently using all in one wp security – F.A Apr 22 at 9:20

I'd change all passwords on your hosting place: hosting access, databases, ftp, and anywhere else.

Then I would look in the 'domains' of your hosting account and delete any that don't belong to you. I'd also contact the hosting support gang to help out.

And I would check all of your file content: htaccess, other files within your 'public_html' (or 'home') folder for anything that doesn't belong.

(And, you might find better answers in another Stack as described. When you create your question there, add as much info as you can: what you have looked at, hosting details, etc).

But, securing your site with strong passwords everywhere is important.

  • Thanks for response, I active cloudflare 'Under Attack Mode' its solved my problem. Now this domain cannot steal my data Link – F.A Apr 22 at 9:29

Hope this will be helpful for others. This is how I stop stealer with javascript

var x = location.hostname;
if ( x != 'www.example.com'){

Then use this javascriptobfuscator to encrypt the script and put on top of header file.

Because of encryption domain name not replaceable (In my case stealer use nginx to change domain name)

If anyone need server side solution

if ($_SERVER['SERVER_NAME'] != "www.example.com"){
    if ($_SERVER['SERVER_NAME'] != "example.com"){
        echo "<script>window.location.replace(\"https://www.example.com/\")</script>";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.