首页 > 解决方案 > Wordpress 保护子目录

问题描述

我有一个在 wordpress 中的站点,它的根目录中有一个文件夹,它是内置在静态 php 中的。

当我尝试使用 .htaccess 保护该站点时,它与 wordpress 的根 .htaccess 冲突。

我已将保护 htaccess 放在文件夹中

这是我放在网站管理员目录 .htaccess 文件中的内容,但它是 404

ErrorDocument 401 /401.html
AuthType Basic
AuthName "welvo maker"
AuthUserFile "/home/welvo/.htpasswds/public_html/webmaster/passwd"
require valid-user

标签: wordpressdirectoryhttp-status-code-404password-protection

解决方案


Hello you can protect subfolder directory using .htaccess by adding below line

RewriteBase   /subfolderdirectoryname 

As well as you can see reference link which will help you to understand better.

使用 htaccess 在子目录中新的重写规则


推荐阅读