Apache LocationMatch 正则表达式与子域

发布于 2024-09-10 19:28:51 字数 289 浏览 4 评论 0原文

我正在尝试使用 LocationMatch 来匹配网站二级子域中的 URL,但不匹配其三级子域中的 URL。这是因为我想用密码保护该级别的某些 URL。

例如。 level2.domain.com/some/url 应该匹配,但不匹配 level3.level2.domain.com/some/url

我会应用必要的指令来密码保护 URL 。

LocationMatch 是否匹配此部分或 URL?我不这么认为,如果是这样的话,我可以用什么来达到预期的效果呢?

I'm trying to use LocationMatch to match an URL in a website's second-level subdomain but not in it's third-level subdomain. This is because I want to password protect some URLs at that level.

eg. level2.domain.com/some/url should match but not level3.level2.domain.com/some/url

Than I would apply the necessary directives to password protect the URLs.

Does LocationMatch match this part or the URL ? I don't think so, and if that's the case, what could I use to achieve the desired effect ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山色无中 2024-09-17 19:28:52

我认为您必须将位置分解为单独的 VirtualHost 块,并适当地使用 ServerName / ServerAlias 来指定您想要覆盖的域。 。

I think you have to break up the locations into separate VirtualHost blocks and use ServerName / ServerAlias appropriately to specify the domains you want to cover...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文