# HTTPS, HSTS and redirects: one version of your site for Google

> How to keep a single version of your site with HTTPS, 301 redirects and HSTS without losing rankings: what to check, what to set up and in what order.

Author: Samuel Hinojosa (CEO & Founder, WITS) · Updated: 2026-11-01 · https://market.wits.mx/en/guides/https-hsts-redirects-seo/

## Why do HTTPS and redirects matter for SEO?

Because your site can answer at four different addresses (http, https, with www and without) and Google treats them as different URLs. With HTTPS everywhere, permanent redirects to one version and HSTS, you concentrate signals on one URL and protect your visitors.

Google announced in 2014 that [HTTPS is a ranking signal](https://developers.google.com/search/blog/2014/08/https-as-ranking-signal). More important than the signal itself: a single version avoids duplicate content and split links.

## Which redirect should you use in each case?

| Code | Type | When to use it |
|---|---|---|
| 301 / 308 | Permanent | Lasting change: http to https, new domain, a URL that changed for good |
| 302 / 307 | Temporary | Promotions or maintenance; Google does not treat it as a canonical signal |
| meta refresh / JavaScript | Client side | Only if you cannot configure the server |

According to Google's [redirects documentation](https://developers.google.com/search/docs/crawling-indexing/301-redirects), a permanent redirect signals that the target should be canonical, and a server-side redirect has the highest chance of being interpreted correctly.

## How do you check your site step by step?

One version

1. Try all four addresses: Open http://, https://, with www and without. All four should end at the same URL.
2. One hop: Each variant should reach the target with a single redirect, not a chain of two or three.
3. Permanent, not temporary: Make sure the redirect returns 301 or 308, not 302.
4. Consistent canonical: Each page's canonical tag should point to the final https version.
5. Links and sitemap up to date: Your sitemap and internal links should use the final URL, not the one that redirects.
6. Turn on HSTS: Once everything works on HTTPS, add the Strict-Transport-Security header.

## What is HSTS and how do you enable it safely?

HSTS is an HTTP header that tells the browser to always use HTTPS for your domain for the time you set, never going through http. The [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security) explains its three options:

```
Strict-Transport-Security: max-age=31536000; includeSubDomains
```

- max-age: seconds the browser will remember to use HTTPS only (31536000 is one year).
- includeSubDomains: also applies to every subdomain. Enable it only if all of them have HTTPS.
- preload: asks to join the list browsers ship with. Getting off it is slow; read [hstspreload.org](https://hstspreload.org/) first.

> Start short: Test with a max-age of minutes or hours, make sure nothing breaks (subdomains, internal tools) and raise it later. In-depth security headers are covered on security.wits.mx.

## Which mistakes cost rankings?

The ones we see most: redirecting everything to the home page instead of the equivalent URL, using 302 for a permanent change, leaving redirect chains after several migrations and canonicals pointing to the http version. Check them in the [SEO audit](https://market.wits.mx/en/guides/free-seo-audit/); an extra redirect also adds load time, as covered in [Core Web Vitals](https://market.wits.mx/en/guides/core-web-vitals/).

The Market OS HTTPS, headers and redirects tool follows your domain's redirect chain, checks HSTS and canonical and tells you what to change. Meanwhile, see the other [free tools](https://market.wits.mx/en/#free-tools) on the way. [Tell me when it is ready](https://market.wits.mx/en/guides/https-hsts-redirects-seo/#contact)

## Frequently asked questions

### Will I lose rankings moving from http to https?

With page-by-page 301 redirects and updated canonicals and sitemap, Google consolidates signals on the new version. Expect some movement while it recrawls.

### Is www or non-www better?

Google does not mind. What matters is choosing one and permanently redirecting the other.

### 301 or 308?

Both are permanent for Google. 308 keeps the request method; for regular pages 301 is the most common.

### Does HSTS improve SEO?

It is not a documented ranking signal. It avoids trips through http and protects your visitors.

### How long should I keep a redirect?

As long as there are links or visits to the old URL. For a domain change, keeping it for a long time is recommended.

## Sources

- [Google Search Central: Redirects and Google Search](https://developers.google.com/search/docs/crawling-indexing/301-redirects)
- [Google Search Central: Consolidate duplicate URLs](https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls)
- [Google Search Central Blog: HTTPS as a ranking signal (2014)](https://developers.google.com/search/blog/2014/08/https-as-ranking-signal)
- [MDN: Strict-Transport-Security](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security)
- [hstspreload.org: HSTS preload list](https://hstspreload.org/)
