Migrating from HTTP to HTTPS: A Complete Step-by-Step Guide
Migrating from HTTP to HTTPS is one of the most impactful improvements you can make for security, SEO, and user trust. Google has used HTTPS as a ranking signal since 2014, and as of 2026, all major browsers mark non-HTTPS sites as "Not Secure." This guide walks you through the complete migration process — from obtaining your certificate to configuring HSTS and monitoring the transition.
Before You Start: Pre-Migration Checklist
Step 1: Obtain an SSL Certificate
Choose your certificate based on your needs:
| Option | Cost | Best For |
|---|---|---|
| Let's Encrypt (Certbot) | Free | Most sites — fully automated |
| Hosting provider SSL | Free–$10/yr | Shared hosting, easy setup |
| Cloudflare Universal SSL | Free | Sites behind Cloudflare |
| DigiCert / Sectigo DV | $50–$200/yr | Commercial sites needing OV/EV |
See our guide on automating SSL renewal for detailed Certbot setup instructions.
Step 2: Install and Configure HTTPS on Your Server
# Nginx — basic HTTPS server block
server {
listen 443 ssl http2;
server_name yourdomain.com www.yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
# Modern SSL settings (TLS 1.2+)
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256;
# HSTS (add after testing - see Step 5)
# add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
root /var/www/html;
index index.html;
}Step 3: Set Up 301 Redirects (HTTP → HTTPS)
301 redirects tell search engines permanently that your content has moved to HTTPS. This transfers your SEO link equity. Do not use 302 (temporary) redirects — they do not pass link equity.
# Nginx redirect (add as a separate server block)
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
# Apache (.htaccess)
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]Also redirect www to non-www (or vice versa) to avoid duplicate content. Pick one canonical form and redirect the other.
Step 4: Fix Internal Links and Mixed Content
Update all internal links, image sources, script tags, and stylesheet links from http:// to https://. See our guide on fixing mixed content warnings for complete instructions.
Step 5: Implement HSTS
HTTP Strict Transport Security (HSTS) tells browsers to always use HTTPS for your domain — even if the user types http://. This prevents SSL-stripping attacks and eliminates the single HTTP redirect your users make on first visit.
Start with a short max-age — start with max-age=300 (5 minutes) and test thoroughly. Once confident, increase to max-age=31536000 (1 year). A misconfigured HSTS header can lock users out of your site if you revert to HTTP.
# Start with short max-age for testing Strict-Transport-Security: max-age=300 # Production (after testing) Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Step 6: Update Google Search Console and Analytics
Add your HTTPS site as a new property. Set it as the preferred domain. Submit your updated HTTPS sitemap.
Update the default URL in property settings to https://. Update any cross-domain tracking configurations.
Update all URLs in your sitemap.xml to use https://. Resubmit to all search engines.
Update all <link rel="canonical"> tags to use https:// URLs.
Update profile links, Open Graph tags, and any hardcoded HTTP URLs in social media profiles.
Post-Migration: What to Monitor
After migrating, use our free SSL Certificate Checker and Security Headers Checker to verify your certificate is valid and HSTS is correctly configured.
Common questions
What is the correct order for migrating HTTP to HTTPS?
1) Install and verify the SSL certificate. 2) Test HTTPS works with no errors or mixed content warnings. 3) Set up 301 redirects from all HTTP URLs to their HTTPS equivalents. 4) Update internal links, sitemaps, and canonical tags to HTTPS. 5) Update Google Search Console to include the HTTPS property. 6) Enable HSTS only after all redirects are confirmed working.
What is mixed content and how do I fix it after migrating?
Mixed content occurs when an HTTPS page loads resources (images, scripts, fonts) over HTTP. Active mixed content (scripts, iframes) is blocked by browsers. Fix by updating all resource URLs to HTTPS, using protocol-relative URLs (//example.com/image.jpg), or adding the Content-Security-Policy: upgrade-insecure-requests header to automatically upgrade HTTP requests.
Does migrating to HTTPS affect SEO?
Positively when done correctly. Google uses HTTPS as a ranking signal. 301 redirects pass ranking equity from HTTP to HTTPS URLs. Submit the HTTPS sitemap to Search Console. Some temporary fluctuation during recrawling is normal. Migrating to HTTPS protects your existing rankings — staying on HTTP risks being marked Not Secure and losing rankings.
Do I need to update my sitemap after migrating to HTTPS?
Yes. Update all URLs in your sitemap from http:// to https://. Submit the updated sitemap in Google Search Console under the HTTPS property (verify both HTTP and HTTPS properties separately). Update the Sitemap reference in robots.txt. Stale HTTP URLs in your sitemap cause Googlebot to follow redirects rather than crawling HTTPS directly.
References and further reading
The specifications and primary documentation this article is based on.
Read next
More guides on the same subject.