wordpress - 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
解决方案
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.
推荐阅读
- python - 如何仅使用正则表达式提取数字?
- r - 正则表达式匹配字符串中重复两次的前几个字符
- android - Powermockito NotAMockException 即使对象是模拟
- java - 将 CDI ProcessObserverMethod 扩展和自定义范围迁移到 Quarkus
- javascript - Angular 页面加载期间网络调用的总时间
- solr - Solr 流式表达式 - 连接多值字段
- javascript - 为什么 React 项目中“公共”文件夹中的背景图像不会根据窗口大小调整大小?
- java - 私有方法的 Junit 测试用例
- python - 创建一个 alembic 迁移来为 version_table_schema 创建架构
- javascript - D3.js:饼图,图表分隔符的不同颜色?