База знаний

Redirect HTTP to HTTPS

Эта статья есть на вашем языке: Как перенаправить HTTP на HTTPS

Enable redirection in WebShield and choose its HTTP status code. First confirm that HTTPS already works with a valid certificate.

Before enabling it

You need a connected website, access to its management page, and a tariff or option that includes free or custom SSL. Set up Free SSL first if needed. Replace example.com in the commands with your domain. Check HTTPS for every connected hostname, including www when used.

Configure the redirect

  1. Open WebShield → Manage project → Manage site → Site protect SSL.
  2. Turn on Force HTTPS. Wait for the save confirmation. This setting saves automatically and has no separate Save button.
  3. Redirect code appears below the switch. If no code has been set, the default is 301. Select the required code and wait for confirmation. For an initial trial, select a temporary code immediately after enabling the switch, then test the website.
  4. Reload the panel page and confirm that the switch and selected code remain set.

Force HTTPS switch and redirect status code

Choose a code

The current dropdown uses Russian labels even in the English interface:

Exact panel label Meaning
301 - постоянный Permanent redirect.
302 - временный Temporary redirect.
307 - временный (метод сохраняется) Temporary redirect that preserves the request method.
308 - постоянный (метод сохраняется) Permanent redirect that preserves the request method.

For POST requests, 301/302 allow the client to change the method to GET; 307/308 preserve it (RFC 9110). Test login, form submissions and API clients after choosing a code. Clients should still use HTTPS directly for their initial request.

Check the redirect

On Windows, run curl.exe -I http://example.com/; elsewhere use curl -I http://example.com/. Expect the selected status code and a Location header containing an HTTPS URL. Test an actual page path with query parameters too, and confirm that following the redirect reaches a working page.

If requests loop, inspect the website's own redirect rules and its HTTPS handling at the origin. To undo the panel setting, turn off Force HTTPS and wait for confirmation. A permanent redirect already cached by a client can continue to affect that client.

HSTS is a separate setting and is unnecessary for testing the redirect. If a browser has already stored an HSTS policy, disabling the redirect does not remove the saved HTTPS requirement before that policy expires (RFC 6797).

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