WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can I include blocked countries IP in my .htaccess file? (8 posts)

  1. raygene
    Member
    Posted 6 years ago #

    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

  2. whooami
    Member
    Posted 6 years ago #

    yes, you can do that.

  3. raygene
    Member
    Posted 6 years ago #

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

    Gene

  4. raygene
    Member
    Posted 6 years ago #

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

    Thanks
    Gene

  5. whooami
    Member
    Posted 6 years ago #

    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. :)

  6. raygene
    Member
    Posted 6 years ago #

    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

  7. whooami
    Member
    Posted 6 years ago #

    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:

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

    Make more sense?

  8. raygene
    Member
    Posted 6 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.