1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Need help with htaccess for blocking access by user-agent

Discussion in 'BlackHat Lounge' started by umerjutt00, May 24, 2016.

  1. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP

    Joined:
    Oct 28, 2011
    Messages:
    3,825
    Likes Received:
    2,066
    Occupation:
    Ninja
    A website is using some kind of auto-blogging plugin to steal all the content from my site. After looking at the logs, I have found the user-agent being used:

    WordPress/4.5.2; http://website.com


    Let's say website.com is the site which is stealing my content.

    How do I block it with htaccess?
     
  2. ChrisX

    ChrisX Jr. VIP Jr. VIP

    Joined:
    Oct 8, 2011
    Messages:
    273
    Likes Received:
    140
    Gender:
    Male
    Home Page:
    You could use something like this (which might also affect other connections from WP instances):

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} WordPress [NC]
    RewriteRule .* - [F,L]
    That said user agent is super easy to change, so it's a better idea to block by IP.
     
    • Thanks Thanks x 1