WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Can I include blocked countries IP in my .htaccess file?

[Resolved] Can I include blocked countries IP in my .htaccess file?

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

    @whooami

    Member

    yes, you can do that.

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

    Gene

    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

    Member

    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. 🙂

    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

    Member

    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?

    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 ‘[Resolved] Can I include blocked countries IP in my .htaccess file?’ is closed to new replies.