База знаний

Redirect www to the domain without www

Эта статья есть на вашем языке: Как перенаправить www на домен без www

Enable this redirect to send www.example.com to example.com. Replace these examples with your hostnames. The setting redirects www to the site's base hostname; it does not offer an arbitrary destination domain.

The redirect card appears for sites created with With www. Both hostnames must point to WebShield. For HTTPS, the certificate must cover both www and the destination: certificate verification happens before the browser receives an HTTP redirect.

Enable the redirect

  1. Open WebShield → Manage project → Manage site → Site protect settings.
  2. Find WWW redirect.
  3. Turn on the switch and wait for confirmation.
  4. In Redirect code, select 301, 302, 307 or 308. The default is 301 if no code has been set. For a temporary trial, immediately select 302 or 307.
  5. Wait for the change to save, reload the page and check the selected code.

WWW redirect switch and response code

301 and 308 mean a permanent move; 302 and 307 mean a temporary move. 307 and 308 preserve the request method; 301 and 302 allow a client to change POST to GET (RFC 9110). The dropdown's descriptions currently remain in Russian, so identify the option by its number.

On Windows, run curl.exe -I https://www.example.com/; elsewhere use curl -I https://www.example.com/. Expect your selected status and a Location header pointing to the hostname without www. Test a page path with query parameters, login and form submissions too.

For a redirect loop, check whether the application sends visitors back to www. Turn off WWW redirect to undo the setting; a permanent redirect already saved by a client can persist. If the card is absent, ask support about connecting www. Configure HTTP-to-HTTPS redirection separately.

Статья была полезна?