Apache2 VirtualHost:拒绝根 URL,但允许路径

Apache2 VirtualHost : deny root URL but allow path

提问人:Sajjad Hossain Sagor 提问时间:9/30/2023 更新时间:9/30/2023 访问量:17

问:

我正在使用下面来阻止访问根 URL...并尝试只允许访问访问路径或根域之后的任何内容......

# Redirect root domain to a 403 Forbidden error
<Location "/">
   Require all denied
</Location>

但是下面 LocationMatch 不起作用......它允许根 URL 和一切......我可能错过了一件很小的事情,请帮忙!!

<LocationMatch "^/.+$">
   Require all granted
</LocationMatch>
正则表达式 Apache Apache2 VirtualHost

评论


答: 暂无答案