Blocking incoming traffic, attempted site hijacks, and multiple URLs in the hypertext access configuration file
It’s more than possible to block incoming traffic on any website using the hypertext access configuration file (.htaccess). Sometimes blocking URLs using rewrite conditions in the .htaccess file can stop or slow down attempted website hijackings, where a malicious website has either forwarded a domain or rewritten their domain to leach on another (victims) website’s traffic. You can also use the .htaccess file to block spam links or block low ranked websites which have linked to your website’s content to prevent Google’s sandbox from taking effect on your website (if this is the case, it is sometimes better to contact the websites and kindly ask for them to remove your links).
How to block a single URL in the .htaccess file
To block a single URL copy and paste the code below into your .htaccess file.
Change only domain\.com to the domain you wish to block, keep the URL in the exact same format, adding a \ before each extension (ie: botcrawl/.com or botcrawl/.co/.uk).
[Normal_Box]
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} domain\.com
RewriteRule .* - [F]
[/Normal_Box]
How to block multiple URLs in the .htaccess file
Blocking multiple URLs in the .htaccess file is a little different than blocking a single URL. [NC,OR] must follow every URL on the conditions list starting with the first one, excluding the last URL on the list.
To block multiple URLs copy and paste the code below into your .htaccess file.
Change only domain\.com (or domain2, etc.) to the domain you wish to block, keep the URL in the exact same format, adding a \ before each extension. (ie: botcrawl\.com or botcrawl\.co\.uk). To add more domains simply follow the previous rule as stated above concerning [NC,OR].
[Normal_Box]
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} domain\.com [NC,OR]
RewriteCond %{HTTP_REFERER} domain2\.net [NC,OR]
RewriteCond %{HTTP_REFERER} domain3\.co\.uk
RewriteRule .* - [F]
[/Normal_Box]
@jameslavey http://t.co/QJHTqYev
@Angel_LaVey if you have control of all aspects of your website you can do it via use of what’s called an htaccess file http://t.co/hKbIIc1W