apache - 如何从基本身份验证中排除一个 url
问题描述
使用 Apache/2.4.41。试图从基本身份验证中排除 1 个 URL。我想排除的 URL 是/index.php?r=admin/remotecontrol
我尝试了许多不同的方法来指定它,但没有一个对我有用。这是我的 .htaccess 文件:
<IfModule mod_rewrite.c>
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/httpd/.htpasswd
Require expr %{REQUEST_URI} =~ m#.*/remotecontrol#
Require valid-user
我错过了什么或做错了什么?
解决方案
推荐阅读
- java - 如何为正在以编程方式运行的测试生成报告(surefire)
- php - 错误:关系“雇员”不存在第 1 行:从“雇员”中选择 * ^
- tensorflow - ValueError:函数的输入张量必须来自`tf.keras.Input`
- c# - 如何解决“错误的 JSON 转义序列:\U”在 blazor 中添加 swagger 端点作为连接服务
- sql-server - 如果组中没有记录比特定数据更新,则分组
- sql - 'WITH' 子句不适用于 in 运算符
- elasticsearch - 如何在 laravel scout 和弹性搜索中使搜索更有效?
- django - ValueError - 视图没有返回 HttpResponse 对象。它返回 None 而不是
- vue.js - 使用 Vuetify v-rating 模块测试组件时,“TypeError:无法读取未定义的属性‘isFilled’”
- entity-framework - 出现错误此操作需要连接到“主”数据库