There was a problem loading the comments.

WordPress SSL Certificate: Add HTTPS on WP Aligned Hosting

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Every domain on WP Aligned hosting gets a free WordPress SSL certificate from Let's Encrypt. cPanel's AutoSSL issues it and renews it for you, so you never buy, upload or renew a certificate by hand. What AutoSSL can't do is switch WordPress itself to https://. This guide covers both halves: confirming the certificate is in place, then moving the site to HTTPS cleanly, with no mixed content warnings, no redirect loops and no stale cached pages.

How SSL works on WP Aligned hosting

  • AutoSSL issues the certificate. Every WP Aligned server uses Let's Encrypt through cPanel AutoSSL. It covers each domain and subdomain in the cPanel account, and the www. version when that name resolves to the server.
  • The domain has to point at us first. Let's Encrypt only issues a certificate after it confirms the domain resolves to our server. A domain that still points at the old host, or at nothing, won't get one.
  • Renewal is automatic. Let's Encrypt certificates last 90 days, and AutoSSL renews them before they expire. Renewal uses the same check, so it can fail later if the domain's DNS or Cloudflare settings change.
  • WordPress has its own setting. The certificate makes https:// work. WordPress keeps using whatever address is in its settings until you change it.

You don't need a paid certificate for a normal WordPress site. A Let's Encrypt certificate is trusted by every current browser and shows the same padlock.

Step 1: Check the WordPress SSL certificate in cPanel

  1. In cPanel, go to Security > SSL/TLS Certificates.

The Security section of the cPanel Tools screen with SSL/TLS Certificates highlighted

  1. Open the Status tab. It lists every domain in the account with its certificate status.

The cPanel SSL/TLS Certificates Status tab showing two domains with AutoSSL Domain Validated and three www and mail names with an AutoSSL DNS DCV error

What the statuses mean:

  • AutoSSL Domain Validated with an expiry date: the certificate is installed and AutoSSL will renew it. Go to Step 2.
  • An error occurred the last time AutoSSL ran: Let's Encrypt couldn't confirm that name points to the server. The message names the reason. See AutoSSL errors below.
  • No status yet on a domain you just added or just pointed at us: AutoSSL hasn't run since the change. Wait a few hours. If there's still no certificate the next day, open a ticket and we'll run AutoSSL for the account.

In the screenshot, www.kb.wpaligned.com and mail.kb.wpaligned.com fail because no DNS record exists for them. That's harmless when the site doesn't use those names. It matters if visitors use www., because they get a certificate warning.

Step 2: Switch WordPress to https

Take a backup before this step. Use the WP-CLI export below, or confirm JetBackup 5 in cPanel has a recent backup of the site.

In wp-admin

  1. Go to Settings > General.
  2. Change WordPress Address (URL) and Site Address (URL) from http:// to https://. Keep the rest of each address exactly as it is, including www. or the lack of it.
  3. Click Save Changes. WordPress logs you out. Log back in on the https:// address.

WordPress General Settings with the WordPress Address and Site Address fields both set to an https address

If those two fields are greyed out, they're set in wp-config.php as WP_HOME and WP_SITEURL. Change them there instead.

With WP-CLI

Open Advanced > Terminal in cPanel (or connect over SSH), go to the site's document root and run:

cd ~/public_html
wp db export ~/before-https.sql
wp option update home 'https://example.com'
wp option update siteurl 'https://example.com'

Replace public_html with the site's document root (shown in Domains > Domains) and example.com with the site's domain. If wp isn't found, use the full path, /usr/local/bin/wp.

Step 3: Fix mixed content

Changing the site address doesn't touch content that's already saved. Image URLs, links and background images inside posts, widgets and page builder data still say http://. When a page served over https:// loads one of those files over http://, the browser calls it mixed content: it may block the file, and it drops the padlock or shows Not secure.

Fix it with a search-and-replace across the database. WP-CLI handles serialized data (the format many plugins and page builders use) safely. Always do a dry run first:

wp search-replace 'http://example.com' 'https://example.com' --all-tables-with-prefix --skip-columns=guid --dry-run --report-changed-only

The dry run lists every table and column it would change and the number of replacements. If the numbers look sensible, run it for real by removing --dry-run:

wp search-replace 'http://example.com' 'https://example.com' --all-tables-with-prefix --skip-columns=guid --report-changed-only

Notes:

  • --skip-columns=guid leaves each post's GUID alone. WordPress uses the GUID as a permanent ID, not a link, and changing it can make feed readers re-show old posts.
  • If the site uses both example.com and www.example.com in old content, run the command once for each form.
  • Without WP-CLI, a search-and-replace plugin that handles serialized data does the same job. Take a backup first either way.
  • Page builders and some themes save generated CSS files with full URLs in them. If a page still shows mixed content after the replace, regenerate that builder's CSS from its settings.

Step 4: Purge the cache

LiteSpeed has cached the http:// versions of your pages, with http:// links inside them. Purge everything so visitors get the new pages: in wp-admin, go to LiteSpeed Cache > Toolbox > Purge and click Purge All. If the site is behind Cloudflare, purge there too. See How to Clear LiteSpeed Cache on WP Aligned Hosting for the details.

Step 5: Force HTTPS for every visitor

Old links, bookmarks and search results still point at http://. Send all of them to https:// with a permanent redirect.

The simplest way is cPanel's built-in switch:

  1. In cPanel, go to Domains > Domains.
  2. Turn on Force HTTPS Redirect for the domain.

The cPanel Domains screen with the Force HTTPS Redirect switch turned on for one domain and off for another

The switch works per domain, so turn it on for each domain and subdomain that should redirect. In our testing it took about two minutes to start redirecting, so wait a moment before you check. If the switch is greyed out, the domain doesn't have a valid certificate yet. Go back to Step 1.

If you prefer to keep the redirect with the site's files (for example, so it moves with the site to another server), add this to the top of the site's .htaccess instead. LiteSpeed reads .htaccess rewrite rules:

# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

Use one method, not both. Don't add this rule to a site that's behind Cloudflare in Flexible mode. See the Cloudflare section below.

Step 6: Check that it worked

  1. Open the site in a private window on http://example.com. It should land on https://example.com with a padlock.
  2. Click the padlock and check the certificate is issued by Let's Encrypt to your domain.
  3. Load a few pages with images, forms and embeds. Open the browser's developer tools (F12), go to the Console tab and look for Mixed Content warnings. Each one names the http:// file that still needs fixing.
  4. From a terminal, confirm the redirect is a single permanent hop:
curl -sI http://example.com/ | grep -iE '^HTTP|^location'

You want a 301 with a location: that starts with https://. If you see a chain of redirects, or the same URL redirecting to itself, see ERR_TOO_MANY_REDIRECTS below.

Sites behind Cloudflare

When a domain is proxied through Cloudflare (orange cloud), visitors get Cloudflare's certificate, and Cloudflare connects to our server separately. The setting that controls that second connection is SSL/TLS > Overview > encryption mode in the Cloudflare dashboard.

For sites on WP Aligned hosting, use Full:

  • Flexible is the one to avoid. Cloudflare connects to our server over plain http://. Once the site forces HTTPS, our server redirects that request to https://, Cloudflare asks again over http://, and the browser gives up with ERR_TOO_MANY_REDIRECTS.
  • Full encrypts the connection to our server and works with the Let's Encrypt certificate AutoSSL installs.
  • Full (strict) also checks that our certificate is valid. That sounds better, but it can deadlock renewal: if the Let's Encrypt certificate ever expires, Cloudflare stops connecting to the server, which also stops Let's Encrypt from confirming the domain, so the certificate can't renew. Someone then has to unstick it by hand. That's why we recommend Full rather than Full (strict). Cloudflare's SSL/TLS Recommender may email suggesting Full (strict); you can ignore that suggestion for sites on our servers.

If you manage the site but the client owns the Cloudflare account, get access to it before you start. See DNS for what we can help with on Cloudflare.

Common problems

ERR_TOO_MANY_REDIRECTS

The redirect loops instead of landing on a page. Check these in order:

  1. Cloudflare is set to Flexible. Change it to Full. This is the most common cause.
  2. Two redirects fight each other. For example, a redirect plugin sends visitors to www. while .htaccess sends them to the bare domain. Keep one redirect method and make sure it matches the address in Settings > General.
  3. A stale cached redirect. Purge LiteSpeed Cache and Cloudflare, then test in a new private window.

"Your connection is not private"

The browser doesn't trust the certificate for the name you visited. Usually one of:

  • The certificate hasn't been issued yet (Step 1 shows no status or an error).
  • You visited www.example.com and only example.com has a certificate, or the other way round. Add the missing DNS record so AutoSSL can cover it, or redirect to the name that works.
  • The domain still points at the old host. See WordPress White Screen or Site Down? Check Domain and DNS.

AutoSSL errors

The Status tab shows the reason. The common ones:

  • does not resolve to any IP addresses: there's no DNS record for that name. Add one pointing at the server, or ignore it if the site never uses that name.
  • resolves to a different address: the name points somewhere else, often the old host or a stray AAAA (IPv6) record. Fix the DNS record. If the domain is behind Cloudflare, check its records there, not at the registrar.
  • A failed HTTP check on a site that otherwise works: a security plugin or a custom .htaccess rule may be blocking /.well-known/acme-challenge/, the path Let's Encrypt uses to confirm the domain. Make sure nothing denies access to /.well-known/.

After you fix DNS, AutoSSL picks it up on its next run. If you don't want to wait, open a ticket.

The padlock is still missing after the search-replace

Something is still loaded over http://. The browser console names it. Typical sources are a hard-coded URL in the theme's files, a widget or menu link typed in by hand, a script embedded from a third-party service that only offers http://, or a page builder's generated CSS. Fix the source, then purge the cache.

Moving a site to us with SSL

When you migrate a site to WP Aligned, AutoSSL can't issue the certificate until DNS points at our server, and the site may show a certificate warning for the first few minutes to hours after the switch. To keep that window short, lower the DNS record's TTL a day before you move it, switch DNS, then check the Status tab and open a ticket if the certificate hasn't appeared once DNS has changed. Sites behind Cloudflare in Full mode usually don't show a warning, because visitors see Cloudflare's certificate while ours is issued.

When to contact us

Open a ticket if:

  • A domain's DNS has pointed at our server for a day and the Status tab still shows no certificate or an error you can't explain.
  • You need a certificate on a name that isn't a domain or subdomain in the cPanel account.
  • Renewal failed and the site shows an expired certificate.

Include the domain and the exact message from the Status tab. See Need Help? for how to reach us.

FAQ

Do I need to buy an SSL certificate for WordPress?

No. AutoSSL gives every domain on WP Aligned hosting a free Let's Encrypt certificate and renews it automatically. Browsers trust it the same way they trust a paid certificate.

Do I need an SSL plugin?

No. The certificate is installed on the server, and the steps above switch WordPress, fix stored URLs and force the redirect without a plugin. Plugins that rewrite http:// to https:// on every page load add work to each uncached request and hide problems you're better off fixing once in the database.

Will switching to HTTPS hurt SEO?

Not when the redirect is a single permanent 301 from each http:// URL to the same https:// URL, which both methods in Step 5 do. Update the site's address in Google Search Console afterwards by adding the https:// version as a property if it isn't there already.

How often does the certificate renew?

Let's Encrypt certificates are valid for 90 days. AutoSSL renews them automatically before they expire, as long as the domain still points at our server.


Share via
Did you find this article useful?  

Related Articles