Allowing BOT to make head request

Home Forums BulletProof Security Pro Allowing BOT to make head request

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #36189
    protection
    Participant

    Hello –

    I came across some info on how to whitelist bots from making head requests here, but just want to make sure it’s still valid, as this topic was over five years ago. What I currently have in my REQUEST METHODS FILTERED is:

    # REQUEST METHODS FILTERED
    # If you want to allow HEAD Requests use BPS Custom Code and copy 
    # this entire REQUEST METHODS FILTERED section of code to this BPS Custom Code 
    # text box: CUSTOM CODE REQUEST METHODS FILTERED.
    # See the CUSTOM CODE REQUEST METHODS FILTERED help text for additional steps.
    RewriteCond %{REQUEST_METHOD} ^(TRACE|DELETE|TRACK|DEBUG) [NC]
    RewriteRule ^(.*)$ - [F]
    RewriteCond %{REQUEST_METHOD} ^(HEAD) [NC]
    RewriteRule ^(.*)$ - [R=405,L]

    Thanks.

    #36190
    AITpro Admin
    Keymaster

    Yep, the info in that forum topic is still valid.  If you want to allow all Bots to make HEAD Requests then you would comment out the last two lines of the code you posted above with pound signs (#).

    #RewriteCond %{REQUEST_METHOD} ^(HEAD) [NC]
    #RewriteRule ^(.*)$ - [R=405,L]
    #36191
    protection
    Participant

    Thank you.

    If I decide to allow one bot only (UptimeRobot) to make a HEAD request, would you recommend I use the code for BPS 11.5+ or 11.6+ on this page? I’m currently using BPS Pro version 13.5.

    #36193
    AITpro Admin
    Keymaster

    Looks like you ended up using the IP Address whitelisting code below instead of whitelisting by User Agent. So you probably want to use that same whitelisting method again if it worked before.

    https://forum.ait-pro.com/forums/topic/split-uptimerobot-whitelist-uptimerobot-bot/#post-5104

    RewriteCond %{REMOTE_ADDR} !^(74.86.158.107) [NC]
    #36195
    protection
    Participant

    Thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.