WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Block IP's with .htaccess? (4 posts)

  1. andriaandco
    Member
    Posted 6 years ago #

    Hi all! I am trying to block certain IP's from accessing my website. Mainly, my sister-in-law. (It's a loooong story.)

    I am confused where to place this block:
    order allow,deny
    deny from 123.45.6.7
    deny from 012.34.5.
    allow from all

    When I am in my .htaccess:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Thanks in advance!

  2. Jeremy Clark
    Moderator
    Posted 6 years ago #

    Place it at the very beginning of the file. As a rule of thumb never edit or put any code between the BEGIN and END wordpress sections as it is overwritten when changing permalinks.

  3. andriaandco
    Member
    Posted 6 years ago #

    Thank you so much Jeremy!

  4. shidouhikari
    Member
    Posted 5 years ago #

    Hello!

    I tried to do this trick in htaccess, but only files like css and js were blocked. Now, a "blocked" IP is still able to see any post and its text, he just can't download style.css and because of that the page is all while with simple text, but it sill can read everything.

    How can I totally block access to anything in my blog?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.