htaccess deny to URL

Is it possible to deny an IP from visiting a specific post on my wordpress blog, maybe by specifying the URL of the post?

Related posts

Leave a Reply

1 comment

  1. <Files abc.html>
        order allow,deny
        deny from 123.45.6.7
        deny from 012.34.5.
        deny from netzero.net
        deny from spaceproxy.com 
        allow from all
    </Files>
    

    You can deny access based upon IP address or an IP block. The above blocks access to the page abc.html from 123.45.6.7, and from any sub domain under the IP block 012.34.5. (012.34.5.1, 012.34.5.2, 012.34.5.3, etc.)

    .htaccess files are

    a) recursive on subdirectories and

    b) cumulative in reverse.

    This can be difficult to understand.

    -The .htaccess in the root directory applies to everything on the site, because it applies to the subdirectories.

    An .htaccess in a subdirectory can override stuff that the parent .htaccess has set.

    RewriteRules apply in reverse order. That is, the current directory rewrites apply first, then the parents rewrites, and so on.

    so why dont you just put these new rules mentioned above in a seperate .htaccess file in the directory which contains the post you want to be protected from a url or an IP.