3分钟
精确匹配
与上面的路径匹配不同,路径匹配不仅匹配对应的路径,而且还会匹配该路径下面的子路径,而精确匹配只能指定的路径,只要在路径前面加$
即可变成精确匹配,类似$url operatorURI
,pattern和operatorURI位置可以调换。
- 包含请求协议
$http://www.test.com operatorURI
$https://www.test.com/xxx? operatorURI
这种情况分别只能匹配这两种请求:
http://www.test.com # 浏览器会自动改为http://www.test.com/
https://www.test.com/xxx?
- 不包含请求协议
$www.test.com/xxx operatorURI
这种情况可以匹配如下四种请求:
http://www.test.com/xxx
https://www.test.com/xxx
ws://www.test.com/xxx
wss://www.test.com/xxx
精确匹配支持非匹配
!$url
学员评价