如何使用 LocationMatch
匹配查询字符串与 Apache ?
<LocationMatch "/index.php\?a=b.*">
// ...
......不幸的是不会工作。
最佳答案
看起来您不能在 Location
中包含查询字符串/LocationMatch
.
来自 Apache Docs :
For all origin (non-proxy) requests, the URL to be matched is a URL-path of the form /path/. No scheme, hostname, port, or query string may be included. For proxy requests, the URL to be matched is of the form scheme://servername/path, and you must include the prefix.
关于Apache,位置匹配 : match query string,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2019594/