我想为Universal Link创建一个路径,该路径仅在有1个文件夹段时才有效。像:
https://example.com/first or https://example.com/first/
但是当网址为:
时,我不希望它进入我的应用https://example.com/first/second
https://example.com/first/index.html
https://example.com/first/second/script.js
https://example.com/first/second/third/image.png
我正在使用这个AASA JSON
"appID": "<appid>",
"paths": [
"*/*.aspx",
"NOT /first/*/*",
"/first/*/"
]
它不起作用。如何通过路径段的数量来控制它?
答案 0 :(得分:0)
*
的问题是您将包含任何字符串组合,包括空字符串。我建议尝试添加?
字符后跟*
以确保字符串不能为空。在您的情况下,请尝试:
"appID": "<appid>",
"paths": [
"*/*.aspx",
"/?*", //Include paths that have '/first/'
"NOT /?*/?*" //For paths that have '/first/second/third' etc
]
希望这适合你。