• Resolved raygene

    (@raygene)


    Hi,

    My blog is aimed at a North American audience and to help block spam, can I append a blocked countries IPs (deny from 89.149.241.229) list in my .htaccess file?

    Thanks,
    Gene

Viewing 7 replies - 1 through 7 (of 7 total)
  • whooami

    (@whooami)

    yes, you can do that.

    Thread Starter raygene

    (@raygene)

    Great, thanks whooami! Didn’t want to foul up my htaccess file.

    Gene

    Thread Starter raygene

    (@raygene)

    Seems that WP doesn’t have a htaccess file, would the blog root directory be the better place to upload it?

    Thanks
    Gene

    whooami

    (@whooami)

    you can put an .htaccess in whatever directory you choose thats web-accessible. They are hierarchical, so if you put in your web-root it will cover it and any subdirs. blog root works too.. blogroot and web-root might even be the same for you. ??

    Thread Starter raygene

    (@raygene)

    To understand the “mechanics” behind this, I do have a htaccess file in my public_html folder, would the one in my blog sub-folder “override” the first one even though the WP one only contains a list of “deny from XX.XX.XX.XXX” or would the system recognize the two?

    Thanks,
    Gene

    whooami

    (@whooami)

    no, and yes thats what I mean by hierarchical..

    Consider this:

    In your public_html .htaccess you put this:

    deny from 10.10.9.150

    In your blog directory .htaccess you put this:

    deny from 10.10.10.11

    10.10.9.150 will not be able to look at any of your site.

    10.10.10.11 will be able to look at everything that’s not inside of your blogroot. In other words, if you had this:

    https://www.mydomains.com/wordpress .. they could look at the https://www.mydomains.com .. just not inside wordpress/

    Make more sense?

    Thread Starter raygene

    (@raygene)

    Thanks, you’re a great mentor and I really appreciate your help.

    The htaccess file in my public_html folder doesn’t deny IPs so I assume that the hierarchy works.

    And yes, it does make sense.

    Thanks again,
    Gene

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Can I include blocked countries IP in my .htaccess file?’ is closed to new replies.