htaccess的问题,htpassword在前端


Problems with htaccess htpassword at frontend

我已经用htaccess/htpassword文件保护了我的wp-admin页面。

. htaccess:

AuthType Basic
AuthName "restricted area"
AuthUserFile /home/x/d/website/www/wp-admin/.htpasswd
require valid-user

.htpassword:

user1:password1
user2:password2

它的工作原理。但是今天,我在网上发布了这个网站。我现在看到的让我很沮丧。几乎所有来自前端的页面也要求用户名/密码!这怎么可能呢?Wordpress有某种链接到后台管理页面?

这怎么可能?请帮帮我。

谢谢。

Gr,灰

可能需要将激活语法添加到目录/文件块中—例如:

 <Directory "/var/www/html/protected">
    AuthType Basic
    AuthName "Authentication Required"
    AuthUserFile ""
    Require valid-user
    Order allow,deny
    Allow from all
 </Directory> also dont forget to restart apache... most common issue ;-)

@YFP:

嘿,伙计,它成功了…我还得到了一个朋友提供的另一个解决方案。看起来像你的解决方案,但这是明确为Wordpress:

AuthType Basic
AuthName "restricted area"
AuthUserFile /home/x/d/xddesign/www/wp-admin/.htpasswd
require valid-user
<Files admin-ajax.php>
    Order allow,deny
    Allow from all
    Satisfy any
</Files>

感谢YFP的帮助!!我想给你的答案投票,但是没有足够的代表…