HTTP to HTTPS Migration
Switching to HTTPS is a technically straightforward task, but it is often done carelessly. Result: mixed content, loss of traffic due to redirect chains, duplication in search engines.
SSL Certificate
Let's Encrypt — free, automatically updated, sufficient for most sites:
# Certbot on Ubuntu
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d mysite.com -d www.mysite.com
# Auto-renewal (already configured by Certbot)
sudo systemctl enable certbot.timer
Paid certificates (Sectigo, DigiCert) — needed for: EV certificates, wildcard on multiple levels, organization validation (OV).
Nginx: HTTPS + HTTP→HTTPS Redirect
# HTTP → HTTPS redirect
server {
listen 80;
server_name mysite.com www.mysite.com;
return 301 https://mysite.com$request_uri; # without www
}
# HTTPS
server {
listen 443 ssl http2;
server_name mysite.com;
ssl_certificate /etc/letsencrypt/live/mysite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mysite.com/privkey.pem;
# Modern TLS configuration (Mozilla SSL Config Generator)
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
# HSTS (add only after verifying HTTPS works!)
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
# ...rest of configuration...
}
Fixing Mixed Content
After switching, the browser blocks HTTP resources on HTTPS pages. Find them:
# Scan for mixed content
npx mixed-content-scanner https://mysite.com
# Or in Chrome DevTools: Console → filter "Mixed Content"
In WordPress — use Better Search Replace plugin to replace http:// → https:// in database.
For other CMS:
-- PostgreSQL
UPDATE posts SET content = replace(content, 'http://mysite.com', 'https://mysite.com');
UPDATE posts SET content = replace(content, 'http://old-cdn.com', 'https://new-cdn.com');
Updating GSC and Yandex Webmaster
- Add HTTPS version as a separate resource
- Set as primary version
- Update sitemap URL (https://)
- Configure preferred domain = https://mysite.com (without www)
Post-Migration Checklist
- All pages open via HTTPS
- HTTP redirects to HTTPS (301)
- www redirects to non-www (or vice versa)
- Canonical tags point to HTTPS
- Sitemap contains HTTPS URLs
- No mixed content warnings
- HSTS header present
- SSL Labs rating A or A+
Switching standard site to HTTPS — 4–8 hours.







