Related Posts



How To Block Incoming Traffic, Backlinks, Attempted Site Hijacks, And Multiple URLs In The .htaccess File

Blocking incoming traffic, attempted site hijacks, and multiple URLs in the hypertext access configuration file

Block URLs in htaccess fileIt’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

Down 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.

Down 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]
 


banner-1

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

2 replies to “How To Block Incoming Traffic, Backlinks, Attempted Site Hijacks, And Multiple URLs In The .htaccess File