- English
- 日本語
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 example.com
and users.example.com
to www.example.com
.
Prerequisites
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 example.com
to www.example.com
, you would add example.com
to your Fastly service and create a DNS A record to point that domain at Fastly.
Adding the redirects
To redirect traffic for an apex domain, wildcard domain, or subdomain, follow the steps below:
- Log in to the Fastly web interface.
- 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.
Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.