---
title: Redirecting apex domains, wildcard domains, and subdomains
summary: null
url: >-
  https://www.fastly.com/documentation/guides/full-site-delivery/responses/redirecting-apex-domains-wildcard-domains-and-subdomains
---

You can use the **Redirect traffic to www subdomains** setting to redirect traffic for apex domains, wildcard domains, or subdomains to a www subdomain so that users always arrive in a consistent location. For example, you could redirect requests from `example.com` and `users.example.com` to `www.example.com`.

## Prerequisites

Before you redirect traffic to a www subdomain, you must [add the domain](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-domains) to your Fastly service and [update the domain's DNS records](https://www.fastly.com/documentation/guides/getting-started/domains/working-with-domains/working-with-cname-records-and-your-dns-provider/) to point to Fastly. For example, to redirect `example.com` to `www.example.com`, you would add `example.com` to your Fastly service and [create a DNS A record](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/using-fastly-with-apex-domains/) to point that domain at Fastly.

## Adding the redirects

To redirect traffic for an apex domain, wildcard domain, or subdomain, follow the steps below:

1.   Log in to the [Fastly control panel](https://manage.fastly.com).

2.   From the [**Home**](https://manage.fastly.com/home) page, select the appropriate service. You can use the search box to search by ID, name, or domain.

3.   Click **Edit configuration** and then select the option to clone the active version.

4.   Click **Settings**.

5. In the **Redirect traffic to www subdomains** area, click **Add apex redirect**.
6. From the **Domains** menu, select the apex domain, wildcard domain, or subdomain you want to redirect.
7. From the **Status** menu, select the [HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#redirection_messages) to send when redirecting traffic from the domains you selected.
8. Click **Add**.
9. Repeat these steps for any other apex domains, wildcard domains, or subdomains you want to redirect.
10.   From the **Activate** menu, select **Activate on Production** to deploy your configuration changes.

## Related content

- [Redirects tutorial](https://www.fastly.com/documentation/solutions/tutorials/redirects/)
