export const meta = {
  title: `Custom domains`,
  description: `Access Amplify Studio on a custom domain`,
};

If your app is set up to use Amplify's web hosting features, you can access Amplify Studio with the custom domain for your app's frontend. For example, if you host your app at `https://example.com`, you can set up a friendly redirect to Studio for the app at a domain address such as `https://example.com/amplify/studio`.

When you connect a custom domain, the process for updating the DNS settings with your third-party DNS provider varies.  For more information about connecting custom domains, see [Set up custom domains](https://docs.aws.amazon.com/amplify/latest/userguide/custom-domains.html) in the *AWS Amplify Console User Guide*. That topic includes instructions for updating your DNS settings with GoDaddy, Google Domains, and Amazon Route 53.

## To set up custom domain access for Studio
1. Sign in to the AWS Management Console and open AWS Amplify.
2. Choose the app that you want to connect to a custom domain for Studio access.
3. In the navigation pane, choose **App settings**, **Domain management**.
4. On the **Domain management** page, choose **Add domain**.
5. Under **Add domain**, for **Domain**, enter your root domain, and then choose **Configure domain**.
6. At the bottom of the **Add domain** page, select the **Set up redirects for custom domain to point to Studio** checkbox. 
7. Update the DNS management settings for your domain with your DNS provider. Note that verification of domain ownership and DNS propagation for third-party domains can take up to 48 hours.

After your app is successfully connected to your custom domain, you can access Studio at your domain address with `/amplify/staging` appended. For example, if your app's domain is `https://example.com`, by default you can access Studio at `https://example.com/amplify/staging`. You can also customize the domain address with a custom redirect rule. 

## To add a redirect rule for Studio access
1. Sign in to the AWS Management Console and open AWS Amplify.
2. Choose the app that you want to add a redirect rule to for Studio access.
3. In the navigation pane, choose **App settings**, **Amplify Studio settings**.
4. The **Domain management** section displays the redirect rules for Studio.
5. Choose **Manage**.
6. Choose **Add redirect rule**, and then do the following:
  * For **Source**, enter a custom redirect rule, for example `/amplify/studio`. 
  * For **Target**, select the backend environment to open Studio for, for example, `staging`.
7. Choose **Save**.

In this example, if an app is hosted at `https://example.com`, Studio for the `staging` backend is available at `https://example.com/amplify/studio`.

