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

  1. andriaandco
    Posted 8 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
    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]

    # END WordPress

    Thanks in advance!

  2. Jeremy Clark
    Posted 8 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
    Posted 8 years ago #

    Thank you so much Jeremy!

  4. shidouhikari
    Posted 7 years ago #


    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


No tags yet.