link-suffix 앞에 있는 URL 부분을 URL 프리픽스라고 하며 이 부분은 커스텀 Dynamic Link 도메인과 경로 프리픽스를 모두 포함합니다. Dynamic Links를 만들 때 이 URL 프리픽스를 제공해야 합니다.
커스텀 도메인을 설정하려면 Firebase 프로젝트의 편집자 또는 소유자 권한이 필요합니다.
Dynamic Links에 웹 도메인 사용
Dynamic Links와 웹페이지, 범용 링크, 앱 링크에 동일한 도메인을 사용할 수 있지만 이 경우 Dynamic Link URL이 웹 URL과 충돌하지 않도록 주의해야 합니다. 특정 URL 프리픽스를 사용하도록 Dynamic Links를 구성하면 이 프리픽스로 시작하는 모든 URL은 Dynamic Links로 처리되므로 일반적인 호스팅 콘텐츠를 가리키는 데 이 프리픽스가 있는 URL을 사용할 수 없습니다.
예를 들어 https://example.com/my-resource 리소스(웹페이지, 범용 링크 또는 앱 링크)에 대한 Dynamic Link를 만들려면 https://example.com/을 Dynamic Links URL 프리픽스로 사용해서는 안 됩니다. 이렇게 하면 https://example.com/my-resource가 Dynamic Link로 처리되기 때문입니다.
대신 다른 도메인 또는 다른 경로 프리픽스가 있는 URL 프리픽스를 사용해야 합니다.
따라서 다음과 같은 긴 Dynamic Links(및 상응하는 짧은 링크)는 link 매개변수로 지정된 URL이 Dynamic Link URL 프리픽스인 https://example.com/으로 시작하므로 의도한 대로 작동하지 않게 됩니다.
Dynamic Links URL 프리픽스가 우선순위가 높은 호스팅 구성과 충돌하지 않아야 합니다. 예를 들어 호스팅되는 정적 콘텐츠는 항상 재작성보다 우선순위가 높습니다.
rewrites 속성 내에서 Hosting 응답은 요청 경로를 캡처하는 첫 번째 source glob에서 지정한 규칙을 준수합니다.
예를 들어 your-domain/source-path/link-suffix에 Dynamic Link를 설정했지만 your-domain/source-path/index.html에 정적 콘텐츠도 있다면 정적 콘텐츠가 우선합니다. 최종 사용자에게는 Dynamic Link 대신 index.html이 표시됩니다. 마찬가지로 your-domain/source-path/link-suffix에 정적 콘텐츠가 있으면 Dynamic Link 대신 정적 콘텐츠가 최종 사용자에게 표시됩니다.
Dynamic Links와 Hosting에 동일한 브랜딩을 사용하려면 Dynamic Links URL 프리픽스에 다음 옵션 중 하나를 사용하세요.
경로 프리픽스와 일치하도록 source 속성을 설정합니다. 예를 들어 커스텀 도메인이 example.com이면 재 작성 규칙은 다음과 같습니다.
// Domain is example.com"rewrites":[{"source":"/links/**",// Dynamic Links start with "https://example.com/links/""dynamicLinks":true}]
Dynamic Links에 사용할 하위 도메인을 설정한 후 하위 도메인과 일치하도록 source 속성을 설정합니다. 예를 들어 하위 도메인이 links.example.com이라면 재작성 규칙은 다음과 같을 수 있습니다.
// Domain is links.example.com"rewrites":[{"source":"/**",// Dynamic Links start with "https://links.example.com/""dynamicLinks":true}]
[null,null,["최종 업데이트: 2025-08-27(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\nYou can have greater control over your Dynamic Links' branding by using your own\ndomain instead of a `page.link` subdomain. With custom domains, you can create\nDynamic Links like the following examples: \n\n```\nhttps://example.com/link-suffix\nhttps://example.com/links/promos/link-suffix\nhttps://links.example.com/link-suffix\nhttps://ex.amp.le/link-suffix\n```\n\nThe part of the URL before \u003cvar translate=\"no\"\u003elink-suffix\u003c/var\u003e is called the *URL prefix* ,\nand contains both your custom Dynamic Link domain and a path prefix. You will need to\nprovide a URL prefix when you create Dynamic Links.\n\nSetting up a custom domain requires Editor or Owner permission on your Firebase\nproject.\n| **Note:** To use a custom domain for Dynamic Links, the domain must point to Firebase Hosting. If you have a domain you want to use with Dynamic Links and the domain points to a different host, you can either move to Firebase Hosting or create a subdomain hosted by Firebase, which you can use for Dynamic Links.\n\nUsing your web domain for Dynamic Links\n\nYou can use the same domain for your Dynamic Links and your web pages, Universal\nLinks, and App Links, but if you do, you must take care that your Dynamic Link URLs\ndon't conflict with your web URLs. When you configure Dynamic Links to use a\nparticular URL prefix, all URLs that begin with that prefix are treated as\nDynamic Links, so you can't use URLs with that prefix to point to ordinary hosted\ncontent.\n\nFor example, if you want to create a Dynamic Link to the resource\n`https://example.com/my-resource` (a web page, Universal Link, or App Link), you\ncan't use `https://example.com/` as the Dynamic Links URL prefix, because doing so\nwould cause `https://example.com/my-resource` to be treated as a Dynamic Link.\nInstead, you must use a URL prefix with either a different domain or a different\npath prefix.\n\nSo, the following long-form Dynamic Links (and equivalent short links) won't work as\nintended because the URLs specified by the `link` parameter start with the\nDynamic Link URL prefix, `https://example.com/`: \n\n```\n https://example.com/?link=https://example.com/my-resource\n https://example.com/?link=https://example.com/resources/my-resource\n```\n\nBut the following long-form Dynamic Links (and equivalent short links) can work,\nbecause the URL prefixes don't conflict with the `link` URLs: \n\n```\n https://link.example.com/?link=https://example.com/my-resource\n https://example.com/links/?link=https://example.com/my-resource\n https://ex.amp.le/?link=https://example.com/my-resource\n```\n\nSet up a custom domain in the Firebase console\n\nYou can usually set up a custom domain completely in the Firebase console. To\ndo so:\n\n1. If you haven't set up Firebase Hosting for your project, open the\n [Hosting page](//console.firebase.google.com/project/_/hosting/) of the Firebase console, click\n **Get Started**, and click through the setup instructions. You don't have to\n complete the indicated steps at this time.\n\n2. Open the [Dynamic Links page](//console.firebase.google.com/project/_/durablelinks/) of the Firebase console.\n\n3. If you haven't used Dynamic Links before, click **Get Started** . Otherwise, click\n **Add URL prefix** from the drop-down menu.\n\n Then, complete the setup wizard, specifying the domain and path prefix you\n want to use when prompted.\n | **Note:** You can't use the same URL prefix for both Dynamic Links and regular hosting. If you want to use the same branding for both, consider using a path prefix (for example, example.com/links) or subdomain (links.example.com/) in your Dynamic Links URL prefix.\n4. **iOS only** : In your Xcode project's `Info.plist` file, create a key called\n `FirebaseDynamicLinksCustomDomains` and set it to your app's Dynamic Links URL\n prefixes. For example:\n\n \u003ckey\u003eFirebaseDynamicLinksCustomDomains\u003c/key\u003e\n \u003carray\u003e\n \u003cstring\u003ehttps://example.com/link\u003c/string\u003e\n \u003cstring\u003ehttps://example.com/promos\u003c/string\u003e\n \u003c/array\u003e\n\nSet up a custom domain manually\n\nIn some situations, such as when you already have a custom domain set up for\nDynamic Links and want to add another domain, or when you are adding a domain already\nconnected to a Hosting site, you have to set up your custom domain manually.\n\nTo do so:\n\n1. [Connect your domain to Firebase Hosting](/docs/hosting/custom-domain)\n if you haven't already done so.\n\n Setting up your domain with Firebase Hosting includes creating the\n configuration file [`firebase.json`](/docs/cli#the_firebasejson_file) in\n your local project directory.\n2. [Update to the latest version of the Firebase CLI](/docs/cli#update-cli)\n (v6.5.0 or later).\n\n3. Configure your Hosting site for Dynamic Links in your project's\n `firebase.json` file. If your project has multiple sites, be sure to\n configure the site connected to the domain you want to use.\n\n - Set `appAssociation` to `AUTO`. With this setting, Hosting\n dynamically generates `assetlinks.json` and `apple-app-site-association`\n files when they are requested.\n\n - Specify the path prefixes you want to use for Dynamic Links by setting rewrite\n rules with `dynamicLinks` set to `true`. Requests to these paths get\n proxied to Dynamic Links.\n\n Unlike rules that rewrite paths to URLs, Dynamic Link rewrite rules can't\n contain regular expressions.\n\n If you have multiple rewrite rules for your site, be aware that\n Hosting executes the first rewrite rule that matches the request.\n\n For example: \n\n \"hosting\": {\n // ...\n \"appAssociation\": \"AUTO\",\n \"rewrites\": [\n {\n \"source\": \"/promos/**\",\n \"dynamicLinks\": true\n },\n {\n \"source\": \"/links/share/**\",\n \"dynamicLinks\": true\n }\n ]\n }\n\n With the above configuration, you can create Dynamic Links with URL prefixes like\n the following examples: \n\n ```\n https://your-domain/promos/link-suffix\n https://your-domain/links/share/link-suffix\n ```\n\n \u003cbr /\u003e\n\n | **Note:** You can't use the same URL prefix for both Dynamic Links and regular hosting. If you want to use the same branding for both, consider using a path prefix (for example, example.com/links) or subdomain (links.example.com/) in your Dynamic Links URL prefix.\n\n If you use this domain only for Dynamic Links, you can use a source path of `/**`\n to create Dynamic Links with no path prefix: \n\n {\n \"source\": \"/**\",\n \"dynamicLinks\": true\n }\n\n With the above rule, you can create Dynamic Links like the following example: \n\n ```\n https://your-domain/link-suffix\n ```\n\n \u003cbr /\u003e\n\n4. Deploy your Hosting configuration changes:\n\n ```\n firebase deploy --only hosting\n ```\n\n \u003cbr /\u003e\n\n *(optional)* You can check the deployed `firebase.json` content using the\n [Hosting REST API](/docs/hosting/reference/rest/v1beta1/sites.releases/list?apix_params=%7B%22parent%22%3A%22sites%2F%3Cyour-site-name%3E%22%2C%22pageSize%22%3A1%7D).\n5. **iOS only** : In your Xcode project's `Info.plist` file, create a key called\n `FirebaseDynamicLinksCustomDomains` and set it to your app's Dynamic Links URL\n prefixes. For example:\n\n \u003ckey\u003eFirebaseDynamicLinksCustomDomains\u003c/key\u003e\n \u003carray\u003e\n \u003cstring\u003ehttps://example.com/promos\u003c/string\u003e\n \u003cstring\u003ehttps://example.com/links/share\u003c/string\u003e\n \u003c/array\u003e\n\nPriority order for Dynamic Links and Hosting\n\nFor Dynamic Links, be particularly aware of\n[hosting priority order](/docs/hosting/full-config#hosting_priority_order).\n\n- Ensure that your Dynamic Links URL prefix doesn't conflict with higher priority hosting configurations (for example, hosted static content always has priority over rewrites).\n- Within the `rewrites` attribute, the Hosting response will obey the rule specified by the *first `source` glob that captures the requested path*.\n\nFor example, if you set up a Dynamic Link for\n\u003cvar translate=\"no\"\u003eyour-domain\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003esource-path\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003elink-suffix\u003c/var\u003e\nbut you also have static content at\n\u003cvar translate=\"no\"\u003eyour-domain\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003esource-path\u003c/var\u003e`/index.html`, the\nstatic content takes precedence. An end-user will see `index.html` rather than\nthe Dynamic Link. Similarly, if you have static content at\n\u003cvar translate=\"no\"\u003eyour-domain\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003esource-path\u003c/var\u003e`/`\u003cvar translate=\"no\"\u003elink-suffix\u003c/var\u003e,\nthe end-user will see the static content rather than the Dynamic Link.\n\nIf you want to use the same branding for both Dynamic Links and Hosting, consider\none of the following options for your Dynamic Links URL prefix:\n\n- Set your `source` attribute to match a path prefix. For example, if you have a\n custom domain of `example.com`, your rewrite rule could be:\n\n // Domain is example.com\n \"rewrites\": [ {\n \"source\": \"/links/**\", // Dynamic Links start with \"https://example.com/links/\"\n \"dynamicLinks\": true\n } ]\n\n- Set up a subdomain to use for Dynamic Links, then set your `source` attribute to\n match that subdomain. For example, if you have a subdomain of\n `links.example.com`, your rewrite rule could be:\n\n // Domain is links.example.com\n \"rewrites\": [ {\n \"source\": \"/**\", // Dynamic Links start with \"https://links.example.com/\"\n \"dynamicLinks\": true\n } ]\n\n| **Note:** You can check the deployed `firebase.json` content using the [Hosting REST API](/docs/hosting/reference/rest/v1beta1/sites.releases/list?apix_params=%7B%22parent%22%3A%22sites%2F%3Cyour-site-name%3E%22%2C%22pageSize%22%3A1%7D)."]]