The Wild

How to Migrate from HTTP to HTTPS with an SSL Certificate

· 4 min read · Mammals

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Migrating your website from HTTP to HTTPS encrypts data between your server and visitors, protecting login credentials, personal information, and payment details from interception. It also boosts trust (padlock icon) and can improve search rankings. To start, you need a domain name, access to your web server (cPanel, Nginx, Apache, etc.), and an SSL certificate—either free via Let's Encrypt or paid from a Certificate Authority (CA).

What You'll Need

  • An SSL certificate (purchased or free from Let's Encrypt)
  • Server access (SSH, cPanel, or hosting control panel)
  • Ability to edit DNS records (for domain validation)
  • A backup of your website files and database
  • Optional: a text editor for editing configuration files

Step-by-Step

  1. Obtain an SSL certificate. If you have cPanel, use the "SSL/TLS" wizard or "Let's Encrypt" icon. For manual servers, use Certbot (e.g., sudo certbot --nginx or --apache) or generate a CSR and buy a cert from a CA. For a single domain, a standard DV cert is sufficient.
  2. Install the certificate on your server. In cPanel, paste the certificate, private key, and CA bundle into the SSL/TLS section. For Nginx, place the cert and key files in a secure directory (e.g., /etc/ssl/) and reference them in your server block. For Apache, update the VirtualHost with SSLCertificateFile and SSLCertificateKeyFile.
  3. Configure your server to use HTTPS. In Nginx, add a listen 443 ssl; directive and include the cert paths. In Apache, enable the SSL module (sudo a2enmod ssl) and add SSLEngine on to the port 443 virtual host. Test with nginx -t or apachectl configtest.
  4. Set up automatic HTTP-to-HTTPS redirects. In Nginx, add a server block on port 80 that returns a 301 redirect to the HTTPS version. In Apache, use RewriteEngine On and RewriteCond %{HTTPS} off then RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]. In cPanel, use the "Force HTTPS Redirect" toggle.
  5. Update all internal links and resources. Search your website's code and database for http:// references and replace them with https:// or use protocol-relative URLs (//). Update hardcoded links in HTML, CSS, JavaScript, and XML sitemaps. If using WordPress, install a plugin like "Really Simple SSL" to automate this.
  6. Update external services and canonical tags. Change your canonical URLs to HTTPS. Update Google Analytics, Search Console, and any third-party integrations (e.g., payment gateways) to use the HTTPS version.
  7. Test the migration. Visit your site using https:// and check for mixed content warnings (browser console). Use online tools like SSL Labs' SSL Test to verify certificate validity and configuration.
  8. Monitor for issues. After going live, watch server logs for 404 errors or redirect loops. Check that all pages load correctly, including images and scripts.

Common Mistakes

  • Forgetting to update internal links: If you miss any http:// links, browsers will show mixed content warnings, and some resources may be blocked.
  • Using a redirect chain: Ensure HTTP redirects go directly to HTTPS (301), not through multiple redirects (e.g., HTTP -> www -> HTTPS).
  • Not updating the XML sitemap: Search engines may still crawl old HTTP URLs, causing duplicate content issues.
  • Ignoring the www vs non-www version: Redirect both to one canonical HTTPS host to avoid duplicate content.
  • Forgetting to renew the certificate: Let's Encrypt certs expire every 90 days; set up auto-renewal.

Tips

  • Use a free Let's Encrypt certificate if you're on a budget—it's secure and widely trusted.
  • Enable HTTP/2 after HTTPS is active; it's faster and requires HTTPS.
  • Use 301 redirects (not 302) to preserve search rankings.
  • Keep your certificate files secure with permissions like 600 or 640.
  • Test on a staging environment before going live to avoid downtime.

Troubleshooting

  • Certificate not trusted: Ensure you installed the full chain (including intermediate certificates). Test with SSL Labs.
  • Redirect loop: This usually happens if your server is redirecting HTTP to HTTPS but also redirecting HTTPS back to HTTP. Check your .htaccess or Nginx config for conflicting rules.
  • Mixed content warnings: Use browser developer tools to find insecure requests. Replace http:// with https:// or use protocol-relative URLs.
  • Site not loading after change: Check your firewall or security group settings—port 443 must be open.
  • SSL handshake fails: Verify that your private key matches the certificate, and that the certificate is not expired.

Frequently Asked Questions

Do I need a paid SSL certificate or is free okay?

Free certificates from Let's Encrypt are secure and trusted by all major browsers. Paid certificates offer higher validation levels (like OV or EV) and sometimes longer validity, but for most sites, free is fine.

Will HTTPS slow down my website?

No, modern HTTPS is fast, especially with HTTP/2. The encryption overhead is negligible, and HTTP/2 actually improves performance.

How long does it take to migrate?

It can take from 30 minutes to a few hours, depending on the size of your site and how many hardcoded links you have. Plan a maintenance window.

Will I lose my search rankings?

If you use 301 redirects and update your sitemap, rankings typically stay stable. Google treats HTTPS as a positive signal, so you may even see a slight boost.

Do I need to update my CDN or cloud provider settings?

Yes, if you use a CDN like Cloudflare, you must enable SSL/TLS there and ensure your origin server also has HTTPS configured to avoid loops.

What if I have a subdomain or wildcard certificate?

Wildcard certificates cover all subdomains (e.g., *.example.com). You still need to configure each subdomain's server to use the certificate and redirect HTTP to HTTPS.