.htaccess整个wordpress网站,除了一页

时间:2015-06-18 00:01:19

标签: wordpress .htaccess passwords

您好我想用.htaccess密码保护我的整个Wordpress网站。除一页以外的所有页面都可供公众查看。我知道还有其他方法内置到wordpress中但是我希望除了使用.htaccess方法保护的页面之外的所有页面。

如何在没有密码的情况下查看该页面?

1 个答案:

答案 0 :(得分:1)

您可以在.htaccess文件中执行此操作。

#require a password for the whole site.
AuthName "Authorization Required"
AuthType Basic
AuthUserFile /path/to/.htpasswd
require valid-user
#allow just this page unprotected
<Files "somepage\.html">
  allow from all
  satisfy any
</Files>

https://wiki.apache.org/httpd/BypassAuthenticationOrAuthorizationRequirements

相关问题