A website may answer at both example.com and www.example.com. Pick one public hostname and redirect the other to it so bookmarks, analytics, and search signals do not split between duplicate addresses.

Configure and test both directions

  • Choose the hostname used in marketing and canonical metadata.
  • Set a permanent server-side redirect from the alternate hostname.
  • Test HTTP and HTTPS variants, including a path and query string.

Do not create a redirect loop or discard useful URL parts. After deployment, inspect the final response and confirm internal links use the preferred hostname.