How can I block specific country ip ranges by htaccess while cloudflare activated?

Home Forums BulletProof Security Free How can I block specific country ip ranges by htaccess while cloudflare activated?

This topic contains 1 reply, has 2 voices, and was last updated by  AITpro Admin 8 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34482

    Vintagepornbay.com
    Participant

    Hi

    I want to activate cloudflare and use it with bps and also with my custom htaccess specific country blocked ip ranges. When I activate cloudflare (by changing nameservers) my htaccess is ignoring by cloudflare and I dont know what should I do to make it compatible with cloudflare.

    Here is my custom country block ip ranges on my htaccess:

    #   BULLETPROOF DEFAULT .HTACCESS      
    #   BULLETPROOF DEFAULT .HTACCESS      
    # WARNING!!! THE default.htaccess FILE DOES NOT PROTECT YOUR WEBSITE AGAINST HACKERS
    # This is a standard generic htaccess file that does NOT provide any website security
    # The DEFAULT .HTACCESS file should be used for testing and troubleshooting purposes only
    # BEGIN BPS WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # BLOCK/FORBID Turkish Spammers by CIDR Blocks
    Order Allow,Deny
    Deny from 5.2.80.0/21
    Deny from 5.11.128.0/17
    Deny from 5.23.120.0/21
    Deny from 5.24.0.0/14
    ...
    ...
    ...
    # END BPS WordPress
    #34483

    AITpro Admin
    Keymaster

    Maybe the problem is a cloudflare cache problem.  Did you flush/clear/delete any/all cloudflare cache after making changes in cloudflare?  htaccess files are distributed server configuration files that instruct your Apache server on how to handle things.  If cloudflare uses htaccess code then you would need to add it in your htaccess file.  You are currently using the BPS Default htaccess file. Is that intentional? are you testing things?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.