【问题标题】:How can allow a url type from .htaccess password protection?如何允许 .htaccess 密码保护中的 url 类型?
【发布时间】:2017-10-12 10:41:29
【问题描述】:

我有一个受 .htaccess 密码保护的网站。现在我想允许该网站的一些 URL。

https://www.exampale.com 受密码保护。 但我不想要https://www.exampale.com/test/page/{variable}

的任何密码弹出显示

这可以在 .htaccess 文件中实现吗?

需要Password protect a specific URL的反向

【问题讨论】:

    标签: php .htaccess


    【解决方案1】:

    您可以将它与mod_setenv 指令结合使用:

    # set variable NO_PASS if URI starts with /test/page/
    SetEnvIfNoCase Request_URI "^/test/page/" NO_PASS
    
    # Allow NO_PASS but ask for password otherwise
    AuthType Basic
    AuthName "My Protected Area"
    AuthUserFile /Full/Path/To/passwords
    Require valid-user
    Satisfy    any
    Order      deny,allow
    Deny from  all
    Allow from env=NO_PASS
    

    【讨论】:

      猜你喜欢
      • 2011-08-25
      • 2011-10-15
      • 2014-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      相关资源
      最近更新 更多