Announcement

Collapse
No announcement yet.

htaccess code to block traffic from a single and multiple referrers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • htaccess code to block traffic from a single and multiple referrers

    To block the traffic from the single and multiple referrers, create the .htaccess file under the domains main document root path and add the following rules as per your requirement.

    For single referrer use the following code

    Code:
    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} example1\.com [NC]
    RewriteRule .* - [F]
    For multiple referrers use the following code

    Code:
    RewriteEngine on
    # Options +FollowSymlinks
    RewriteCond %{HTTP_REFERER} example1\.com [NC,OR]
    RewriteCond %{HTTP_REFERER} example2\.com
    RewriteRule .* - [F]
    Regards,
    George S
Working...
X