wordpress 2026-12-02 ⏱ 3 min read

Enable HTTPS on a Static Website

Enable HTTPS on a Static Website

Enabling HTTPS on a static website takes one setting on most hosts and a few minutes of work on your own server. There is no application to configure, so the only things that go wrong are DNS, the redirect and mixed content. This guide covers GitHub Pages, Netlify, Cloudflare Pages, S3 with CloudFront, and the self-hosted case.

Enable HTTPS on a static website by hosting type

HostHTTPSWhat you do
GitHub PagesFree, automatic for custom domainsSet the domain, then tick Enforce HTTPS in Pages settings
NetlifyFree, automaticAdd the domain, wait for provisioning
Cloudflare PagesFree, automaticAdd a custom domain; DNS must be on Cloudflare for some setups
VercelFree, automaticAdd the domain and set DNS as instructed
AWS S3 plus CloudFrontFree certificate via AWS Certificate ManagerRequest in us-east-1, attach to the distribution
Your own server or shared hostingFree certificate you installSee below

Managed hosts: the DNS part

On managed hosts, HTTPS usually fails to appear because DNS is wrong. Point your domain at the host exactly as their instructions say, with A or CNAME records. Verify with the DNS lookup tool. Provisioning can take a few minutes to a few hours after DNS is correct. Do not add conflicting records, such as an old A record to a previous host, because they can block issuance. GitHub Pages also checks for CAA records that exclude Let's Encrypt.

Self-hosted: Nginx and a free certificate

If you control the server, use certbot:

sudo apt install nginx
sudo snap install --classic certbot
sudo certbot --nginx -d example.com -d www.example.com

Without shell access, such as on basic shared hosting, issue a certificate in the browser with TryFreeSSL, then install it in your control panel (cPanel: SSL/TLS, Manage SSL Sites).

Force HTTPS

# 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://%{HTTP_HOST}/$1 [R=301,L]

On Netlify, Cloudflare Pages and similar hosts, HTTP redirects to HTTPS automatically. On GitHub Pages, use the Enforce HTTPS box.

Fix mixed content on a static HTTPS website

Static pages often contain hard-coded http:// links to images, fonts or scripts. Search your files and change them:

grep -rn "http://" --include=*.html --include=*.css --include=*.js .

Use HTTPS URLs or relative paths such as /images/logo.png. If a third party only offers HTTP, replace it.

Test the result

  1. Scan the domain with the Live SSL Checker.
  2. Follow the redirect chain with the HTTPS redirect checker.
  3. Open the site in a private window and check the console for mixed content.
  4. Add HSTS only when everything works. Test with the security headers checker.

Related reading: SSL plugins for WordPress and free SSL without buying hosting.

Frequently Asked Questions

Do static sites need HTTPS?

Yes. Without it, browsers mark pages as not secure, content can be altered in transit, and some browser features are unavailable.

Is the free certificate good enough?

Yes. It provides the same encryption as paid DV certificates.

Why does GitHub Pages show no HTTPS option?

The certificate has not been issued yet. Check DNS and wait. Removing and re-adding the custom domain can restart the process.

What about www versus the apex?

Pick one as primary and redirect the other. Make sure the certificate covers both.

Do static sites need HTTPS?

Yes. Without it, browsers mark pages as not secure, content can be altered in transit, and some browser features are unavailable.

Is the free certificate good enough?

Yes. It provides the same encryption as paid DV certificates.

Why does GitHub Pages show no HTTPS option?

The certificate has not been issued yet. Check DNS and wait. Removing and re-adding the custom domain can restart the process.

What about www versus the apex?

Pick one as primary and redirect the other. Make sure the certificate covers both.

Do I need to change anything in my HTML?

Only http:// links to images, fonts, scripts and stylesheets. Absolute links to your own domain should become https or relative paths.

🔒 Test Your Website SSL Certificate Now
Run Free SSL Check →

✅ 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