Support
Domain Redirects

Redirect non-www to www (or www to non-www)

Direct Answer

To send example.com to www.example.com, create a domain redirect from example.com to https://www.example.com with 301 and Keep the path, then point only the bare domain (the A record at @) to RedirHub. Leave www pointing to your website. For the opposite direction, redirect www.example.com and point only www to RedirHub.

This example at a glance
ItemDetails
GoalOne canonical host, so every visitor and search engine lands on www.example.com (or on example.com)
You needA RedirHub workspace (the 14-day trial is enough) and access to the domain's DNS
Redirect type301 Permanent
TimeAbout 5 minutes, plus DNS propagation

Redirect non-www to www#

  1. In Links, click Create and choose Domain Redirect.
  2. Redirect from: example.com. Redirect to: https://www.example.com.
  3. Choose 301 Permanent and Keep the path. Under More options, turn on Query forwarding if your links carry parameters such as UTM tags.
  4. Check the What happens panel: example.com/about should go to https://www.example.com/about with a 301. Click Create redirect.
  5. Open Connect DNS for example.com and change the A record at @ to the address it shows, plus the TXT record for verification. Remove any other A or AAAA records at @.
  6. Don't change the www record. www must keep pointing to the server that hosts your website.

Avoid a loop

A redirect for the bare domain also covers www whenever www points to RedirHub. If you point both names to RedirHub, www.example.com is redirected to itself and visitors see "too many redirects". Only the name you are redirecting away from should point to RedirHub.

Redirect www to non-www#

  1. Create a Domain Redirect from www.example.com to https://example.com, with 301 Permanent and Keep the path.
  2. In Connect DNS, set www as a CNAME to the target it shows, and remove any other record for www.
  3. Leave the A record at @ pointing to your website.

Result#

Requests after the non-www to www redirect is live
RequestResponseLands on
http://example.com301https://www.example.com/
https://example.com/about301https://www.example.com/about
https://example.com/shop?utm_source=mail301https://www.example.com/shop?utm_source=mail (with Query forwarding on)
https://www.example.com/about200Your website, unchanged

HTTPS for example.com is issued automatically once DNS is in place; see Automatic HTTPS. To confirm a single 301 hop, trace the URL in the Redirect Checker. If you see a loop, read Fix redirect chains and loops.

Frequently asked questions

Either works for SEO. What matters is choosing one and redirecting the other to it with a 301, so links and rankings build up on a single host.

Both names probably point to RedirHub. A bare-domain redirect also covers www when www points to RedirHub, so www is sent to itself. Point only the name you redirect away from to RedirHub.

No. RedirHub answers both http:// and https:// for the domain and redirects both to the destination.

Many registrars can forward a domain, but often without HTTPS on the source or without keeping the path. RedirHub keeps the path and query string and issues HTTPS automatically.

Related help

View All Articles