【问题标题】:.htaccess/.htpasswd failing to protect .html files only - works on all other files.htaccess/.htpasswd 无法仅保护 .html 文件 - 适用于所有其他文件
【发布时间】:2019-01-08 02:30:01
【问题描述】:

我正在尝试在网站上设置基本的 .htaccess/.htpasswd 保护,就像我之前做过一百万次一样。我的 .htaccess 文件如下所示:

AuthType Basic
AuthName "My Protected Area"
AuthUserFile /home/runcloud/webapps/dev/.htpasswd
Require valid-user

出于某种原因,这在所有文件/子文件夹上都可以正常工作,除了 .html 文件。如果您直接访问 protecteddomain.com/index.html,它将绕过 .htpasswd 保护。

谁能帮我解释一下?这是在通过 Runcloud.io 控制面板控制的 Ubuntu 18.04/Apache 服务器上。不确定我的服务器上是否存在配置问题、runcloud 错误或 18.04/Apache 中的错误。糊涂了!

【问题讨论】:

    标签: .htaccess ubuntu password-protection .htpasswd


    【解决方案1】:

    好的 - 所以我发现从另一个网络浏览时这个问题消失了。因此,这里肯定存在某种与 IP 相关的问题。我仍然不完全确定根本问题是什么,但希望这可能会让其他人头疼。

    【讨论】:

      猜你喜欢
      • 2012-07-02
      • 1970-01-01
      • 1970-01-01
      • 2010-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-09
      相关资源
      最近更新 更多