【发布时间】:2015-07-15 19:47:13
【问题描述】:
我有一个使用永久链接的 Wordpress 安装,使用 mod_rewrite:
mysite.com/wp/post?id=3 becomes mysite.com/cats/furrycat
现在我想阻止访问者看到 mysite.com/notes/ 中的帖子。此文件夹不存在,因为它只是一个 wordpress 类别。
如何在根 .htaccess 中阻止对 /notes/ 的访问?
【问题讨论】:
-
来自stackoverflow.com/a/6032162/1810128 RewriteRule ^notes/(.*)$ - [F]
-
为什么不使用
<Location /notes/>\n Order deny,allow\n Deny from all\n </Location>?
标签: .htaccess mod-rewrite