> Caution:
> These steps redirect traffic from the online store to your Hydrogen storefront. Before you begin, ensure that you've completed your Hydrogen build and [tested](https://shopify.dev/custom-storefronts/hydrogen/best-practices/testing) it in development.

> You should review the [production checklist](/docs/storefronts/headless/hydrogen/production-checklist) before launching your store on Hydrogen.

When your Hydrogen storefront is ready for launch, you might need to redirect online traffic from the online store to your Hydrogen storefront so that customers don't mistakenly land on the wrong storefront.

In this tutorial, you'll learn how to redirect traffic from the online store to your Hydrogen storefront.

## Requirements

- You've [completed your Hydrogen build and your Hydrogen storefront is ready for launch](/docs/storefronts/headless/hydrogen/production-checklist).
- You've added a [domain](https://help.shopify.com/en/manual/domains/add-a-domain) and [subdomain](https://help.shopify.com/en/manual/domains/add-a-domain/add-subdomains) to your domain settings.

## Step 1: Set up the domains

This step describes how to set up a primary domain to receive traffic for the Hydrogen storefront while using a subdomain to receive traffic for the Shopify web checkout.

> Tip:
> The [hydrogen.shop](https://hydrogen.shop/) demo provides an example of this routing pattern. The primary domain `hydrogen.shop` receives traffic on the Hydrogen storefront while the subdomain `checkout.hydrogen.shop` receives traffic at checkout.

### Update domain DNS to point to Shopify

1. Point the subdomain and the primary domain to Shopify by updating [DNS records](https://help.shopify.com/en/manual/domains/add-a-domain/connecting-domains/connect-domain-manual#change-your-dns-records)

> Note:
> For custom storefronts not hosted on Oxygen, only the subdomain must point to Shopify.

### Direct checkout traffic to the subdomain

1. From the Shopify admin, click **Settings** > **Domains**.
1. For the **Subdomain** that you connected to Shopify, change the **Target** to **Online Store**.
1. Set the domain type to **Primary**.

### Make the Hydrogen storefront public

1. From the Shopify admin, under **Sales channels**, click **Hydrogen**.
1. In the **Hydrogen storefronts** interface, select the storefront that you want to receive online store traffic.
1. Click `…` beside the production environment, and then click **Edit environment**.
1. Change the **URL privacy** to **Public**, and then click **Save**.

### Direct online store traffic to the domain

1. From the Shopify admin, click **Settings** > **Domains**.
1. For the domain that you want to receive online store traffic, change the **Target** to the production **Hydrogen storefront**.
1. Set the domain type to **Primary**.

Make sure you also update any additional redirect domains to also target your Hydrogen storefront.

### Remove password protection (if enabled)

1. From the Shopify admin, under **Sales channels**, click **Online Store** > **Preferences**.
1. In the **Restrict store access** section, deselect **Restrict access to visitors with the password**.
1. Click **Save**.

## Step 2: Redirect visitors to the Hydrogen storefront

After going live on a Hydrogen storefront, your online store remains active. Visitors can browse online store pages if they visit your `{shop}.myshopify.com` URL. If you want to serve your Hydrogen storefront to visitors who land on online store pages, then you should download and publish the [Hydrogen redirect theme](https://github.com/shopify/hydrogen-redirect-theme), which includes client-side redirection in the `theme.liquid` template and a customized `checkpoint.liquid` template to use with bot protection.