seo 2026-12-02 ⏱ 3 min read

Redirect HTTP to HTTPS Without Losing SEO

Redirect HTTP to HTTPS Without Losing SEO
Quick Answer: Redirect every HTTP URL to its HTTPS twin with a single 301, keep the path and query string, update canonicals, internal links and sitemaps to HTTPS, and add HSTS only after everything works. Done this way the move is low risk for rankings.

Redirect HTTP to HTTPS for SEO: why 301

A 301 tells search engines the move is permanent so signals consolidate on the HTTPS URL. A 302 says it is temporary and can leave the old URL indexed. Avoid chains such as http to https to www: send visitors to the final URL in one hop.

Redirect configs

Nginx

server {
    listen 80;
    server_name example.com www.example.com;
    return 301 https://example.com$request_uri;
}

Apache (.htaccess)

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301]

Pick one canonical host, with or without www, and use it everywhere. Test any URL with the HTTPS Redirect tool or the Redirect Checker.

Redirect HTTP to HTTPS for SEO: what to update

ItemAction
Canonical tagsPoint to the https URL
Internal linksUse https or relative URLs
XML sitemapList only https URLs and resubmit
Images, scripts, CSSLoad over https to avoid mixed content
Hreflang and structured dataUse https URLs
Search ConsoleAdd the https property and check coverage
Backlinks you controlUpdate profile and social links

Add HSTS last

HSTS tells browsers to use HTTPS only. It is hard to undo, so start small:

Strict-Transport-Security: max-age=300

If nothing breaks, raise it step by step, for example to a day, a week, then a longer period. Only add includeSubDomains when every subdomain serves valid HTTPS. Check the header with Security Headers.

Common mistakes

  • Redirecting everything to the home page instead of the matching URL.
  • Leaving a redirect chain of two or three hops.
  • Forgetting that the certificate must cover both the bare domain and www.
  • Mixed content that keeps the padlock from showing.
  • Blocking the https site in robots.txt or leaving a noindex from staging.

Need a certificate first?

Issue a free one on TryFreeSSL.com, install it, and confirm with the SSL Checker before turning on the redirect.

Related reading: the server rules for Apache, Nginx and IIS and the full migration guide.

Frequently Asked Questions

Will rankings drop after the move?

Short fluctuations can happen while search engines recrawl. A correct 301 setup normally keeps rankings stable.

Do I keep the redirect forever?

Keep it for as long as you can. Old links and bookmarks will keep arriving on HTTP.

Is HSTS required?

No, but it prevents downgrade attacks and removes the HTTP hop for returning visitors.

What about CDN or proxy redirects?

Use one layer for the redirect. Doing it on both the CDN and the origin can create loops.

Will a redirect pass all the ranking value?

Search engines treat a permanent redirect as a signal to move the URL, and carry the signals to the new one. Chains and temporary redirects weaken that, so use one hop and a 301.

Do I need to redirect every URL individually?

No, but the rule has to keep the path. A redirect that sends everything to the home page loses the mapping between old and new URLs, which is what search engines need.

How long should I keep the redirect?

Keep it permanently. Old links, bookmarks and printed URLs keep arriving for years, and a redirect costs nothing once it is in place.

Does HSTS help SEO?

Not directly. It tells browsers to use HTTPS for a period, which protects visitors, and it is hard to undo, so add it after the redirect has worked for a while.

What about the query string?

Keep it. A redirect rule that drops the query string sends visitors to the right path with the wrong parameters, which breaks tracking and some pages.

↪️ Generate .htaccess & Nginx 301 HTTPS Redirects
Generate 301 Rules →

✅ Post-Installation Verification & SEO Checklist

After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:

  • Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
  • Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
  • Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
  • Confirm both root and www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant