Apache 别名问题

发布于 2024-08-27 20:08:25 字数 159 浏览 3 评论 0原文

是否可以让 Apache 服务器在评估其位置之前评估其别名?

Alias /foo /bar
<Location "/bar">
SetHandler None
</Location>

那么上面的代码可以工作吗?

Is it possible to have an Apache Server evaluate its Aliases before it evaluates its Locations?

Alias /foo /bar
<Location "/bar">
SetHandler None
</Location>

So that the above code will work?

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

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

发布评论

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

评论(1

冬天的雪花 2024-09-03 20:08:25

实际上它会,但是根据您的示例,您没有正确使用别名。它处理 URL 到文件/目录的映射,这就是您的位置指令不适用的原因。

这就是我认为您正在寻找的:

Alias /foo /var/www/foo
Alias /bar /var/www/foo
<Location "/bar">
    SetHandler None
</Location>

Actually it will, but based on your example you are not using alias correctly. It handles URL to file/directory mapping, which is why your location directive is not applying.

This is what I think you're looking for:

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