Redirecting apex domains, wildcard domains, and subdomains
Last updated 2023-09-19
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
Before you redirect traffic to a www subdomain, you must add the domain to your Fastly service and update the domain's DNS records to point to Fastly. For example, to redirect
www.example.com, you would add
example.com to your Fastly service and create a DNS A record to point that domain at Fastly.
To redirect traffic for an apex domain, wildcard domain, or subdomain, follow the steps below:
- Log in to the Fastly web interface. The Home page appears displaying a list of all services associated with your account.
- From the Home page, select the appropriate service. You can use the search box to search by ID, name, or domain.
- Click Edit configuration and then select the option to clone the active version.
- Click Settings.
- In the Redirect traffic to www subdomains area, click Add apex redirect.
- From the Domains menu, select the apex domain, wildcard domain, or subdomain you want to redirect.
- From the Status menu, select the HTTP status code to send when redirecting traffic from the domains you selected.
- Click Add.
- Repeat these steps for any other apex domains, wildcard domains, or subdomains you want to redirect.
- Click Activate to deploy your configuration changes.