开发者

htaccess deny to URL

Is it possible to deny an IP from visiting a specific post on my wordpress blog, maybe by spe开发者_开发技巧cifying the URL of the post?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜