Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Để ngăn các bên trái phép sử dụng khoá API của bạn để tạo Dynamic Links chuyển hướng từ miền của bạn đến các trang web mà bạn không sở hữu, bạn nên chỉ định các URL mà Dynamic Links của bạn có thể chuyển hướng đến.
Để chỉ định các URL được phép, hãy nhấp vào more_vert> Mẫu URL trong danh sách cho phép trên trang Dynamic Links của bảng điều khiển Firebase, sau đó chỉ định tối đa 10 biểu thức chính quy bằng cách sử dụng cú pháp RE2. Chỉ những URL khớp với một trong các biểu thức chính quy này mới có thể được dùng thành công làm đường liên kết sâu (link) hoặc đường liên kết dự phòng (afl, ifl, ipfl, ofl) cho Dynamic Links. Nếu bạn chỉ định mẫu URL, mọi URL không khớp với một trong các mẫu sẽ khiến Dynamic Links của bạn trả về lỗi HTTP 400.
Bạn nên đặt mẫu URL hạn chế nhất có thể. Ví dụ:
Quá dễ dãi
Tốt hơn
^https://.*.com/.*$
Có thể chuyển hướng đến bất kỳ trang nào trên trang web có đuôi .com.
^https://mybrand\.com/.*$
Chỉ có thể chuyển hướng đến các trang tại mybrand.com.
^https://play.google.com/.*$
Có thể chuyển hướng đến trang Google Play Store của bất kỳ ứng dụng nào.
^https://play\.google\.com/.*id=myapp\.com$
Chỉ có thể chuyển hướng đến các trang Google Play Store cho ứng dụng có tên gói myapp.com.
^https://itunes.apple.com/.*$
Có thể chuyển hướng đến bất kỳ trang nào trên itunes.apple.com.
^https://itunes\.apple\.com/.*id123$
Chỉ có thể chuyển hướng đến trang App Store của ứng dụng có mã nhận dạng id123.
Bạn có thể đảm bảo rằng đường liên kết sâu và đường liên kết dự phòng cho Dynamic Links khớp với một trong các mẫu URL của bạn bằng cách xem trang gỡ lỗi cho Dynamic Links và xác minh rằng không có cảnh báo nào:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["\u003cbr /\u003e\n\n| **Deprecated:** Firebase Dynamic Links is *deprecated* and should not be adopted in projects that don't already use it. The service will shut down on August 25, 2025. See the [Dynamic Links Deprecation FAQ](/support/dynamic-links-faq) for more information.\n\nTo prevent unauthorized parties from using your API key to create Dynamic Links that\nredirect from your domain to sites you don't own, you should specify the URLs\nyour Dynamic Links can redirect to.\n\nTo specify the allowed URLs, click\nmore_vert **\\\u003e Allowlist URL pattern**\nfrom the Dynamic Links page of the Firebase console, and then specify up to\n10 regular expressions using\n[RE2 syntax](https://github.com/google/re2/wiki/Syntax). Only URLs\nthat match one of these regular expressions can be successfully used as a deep\nlink (`link`) or fallback link (`afl`, `ifl`, `ipfl`, `ofl`) for a Dynamic Links. If\nyou specify URL patterns, any URL that doesn't match one of the patterns will\ncause your Dynamic Links to return HTTP error 400.\n\nYou should make your URL patterns as restrictive as possible. For example:\n\n| Too permissive | Better |\n|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| `^https://.*.com/.*$` Can redirect to any page on any site ending with `.com`. | `^https://mybrand\\.com/.*$` Can redirect only to pages at `mybrand.com`. |\n| `^https://play.google.com/.*$` Can redirect to any app's Google Play Store page. | `^https://play\\.google\\.com/.*id=myapp\\.com$` Can redirect only to Google Play Store pages for the app with the package name `myapp.com`. |\n| `^https://itunes.apple.com/.*$` Can redirect to any page on `itunes.apple.com`. | `^https://itunes\\.apple\\.com/.*id123$` Can redirect only to the App Store page for the app with the ID `id123`. |\n\nYou can make sure a deep link and fallback links for a Dynamic Links match one of\nyour URL patterns by viewing the debug page for Dynamic Links and verifying there are\nno warnings: \n\n```\nhttps://example.page.link/WXYZ?d=1\n```"]]