View Full Version : .htaccess script to block a domain?
russell
06-24-2005, 11:12 PM
I recently started my third site with futurequest and had something that has never happened before. Another person, one time hosted on fq, has mirrored my site and is pointing to my server. After a brief exchance with fq support, they suggested I might, other things, block his domain through .htaccess.
Please forgive me, I know nothing about this. I'm wondering and hoping that there is someone here who might offer a script, or a place where I might find one, that I could add to my page to block this person's domain.
Thanks very much for any help or suggestions.
Hello Russell,
I wonder if you used a .htaccess directive similar to the below if it would work...
RewriteEngine On
RewriteCond %{HTTP_HOST} ^offendingdomain.com
RewriteRule (.+) http://www.yourdomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.offendingdomain.com
RewriteRule (.+) http://www.yourdomain.com/$1 [R=301,L]
This would change the URL displayed in the browser location bar to your domain when someone accessed http://offendingdomain.com
You could also use this to redirect visitors that use the offending domains address to something like Yahoo or Google.
RewriteCond %{HTTP_HOST} ^offendingdomain.com
RewriteRule (.+) http://www.google.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www.offendingdomain.com
RewriteRule (.+) http://www.google.com/$1 [R=301,L]
I tested the above on an account I have and it appeared to work. This would also possibly provide the work around for thos that have an IRO and only want the main Domain name to show in the browser location bar when visitors access using the IRO address.
-Bob
Another person, one time hosted on fq, has mirrored my site and is pointing to my server.
Actually, the other way around. They were probably using custom DNS at either their registrar or another web host to point their domain to the IP that had been assigned to them by FQ and left the pointer in place when they closed their account at FQ. At that time the IP would have been deactivated and their domain would have returned a timeout error. Now that the IP has been reactivated, their domain points to whatever content is located there, which just happens to be your domain.
Since they no longer control the IP, they would be in violation of the Terms of Service of whatever company is providing them with custom DNS. You can find out which company that is by doing a DNS lookup of the NS record for their domain at http://www.DNSstuff.com (first box under Hostname Tests). You can then complain to the company directly.
The company will want to verify that the IP is now assigned to your domain, which they will be able to do using a reverse DNS lookup. They will also want some indication that you have not agreed to share your IP with their customer. For this reason I believe it is best to simply block access from their customer's domain. You should be able to place this code in /big/dom/xdomain/www/.htaccess:
SetEnvIf Host offendingdomain.com spurious_pointer=1
Deny from env=spurious_pointer
This will block offendingdomain.com as well as *.offendingdomain.com.
If the company gives you any problems, then I would implement Bob's redirect solution and point the offending domain back to them.
--
Don
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.