Stop another domain from displaying my website
Hi,
I've found out that another website is somehow displaying my website on their domain. So if I type in their url/domain into a browser my content is loaded at their domain. I assume they have set my servers ip address in a dns record.
I have contacted cloudflare which they are using and their host to try to get it taken down. But would appreciate any advice on what I can do from my side to stop it happening in the meantime.
Edit to say - using the below code at the top of .htaccess works:
RewriteCond %{HTTP_HOST} ^(www\.)?badwebsite\.com$
RewriteRule ^/?(.*)
-
Hey there! If the .htaccess code you posted does indeed resolve the issue, that would indicate they have indeed pointed the DNS to your system. There isn't a way to can solve that, except by performing the work you have done already. I would recommend changing that to redirect to a 404 page or some other error message to help deter that traffic. 0 -
You're welcome! 0 -
Yes, but you'd need some more advanced rewrite rules. While I don't claim to be a .htaccess wizard, how about this: RewriteEngine on RewriteCond %{http_host} ^www.badwebsite.com [NC,OR] RewriteCond %{http_host} ^badwebsite.com [NC] RewriteRule ^(.*)$ http://www.example.co.uk./ [R=301,NC,L]0 -
Thanks. I modified it slightly to give a 403 forbidden response. Everything is now working as intended. RewriteEngine on RewriteCond %{http_host} ^www.badwebsite.com [NC,OR] RewriteCond %{http_host} ^badwebsite.com [NC] RewriteRule ^(.*)$ https://www.example.co.uk [R=403,NC,L]0
Please sign in to leave a comment.
Comments
6 comments