A visitor who reaches your site through an old HTTP bookmark should land on the secure version automatically. That is the goal when learning how to force HTTPS and redirect HTTP to HTTPS in cPanel. Once the redirect is set correctly, every version of your site uses the encrypted connection your SSL certificate was issued for.

This is a small hosting task with a meaningful payoff. HTTPS protects information sent between your website and its visitors, helps browsers avoid security warnings, and prevents your traffic from splitting between HTTP and HTTPS URLs. The setup is usually quick in cPanel, but it only works properly after your SSL certificate is active.

Check that SSL is active before creating a redirect

Do not redirect visitors to HTTPS until your domain opens successfully at https://yourdomain.com. If the certificate is missing, expired, or assigned to the wrong domain, visitors may see a browser warning instead of your website.

In cPanel, open SSL/TLS Status. Find your domain and confirm it shows a valid certificate. Many shared hosting accounts include free AutoSSL, which can issue and renew a certificate automatically after the domain points to the hosting account.

If the certificate is not active yet, first confirm that your domain’s DNS points to the correct hosting server. Then run AutoSSL if that option is available, or contact hosting support for help. It can take time for DNS changes and certificate validation to complete, so avoid troubleshooting redirects until HTTPS itself works.

Also decide which address you want to use as your permanent website address: https://yourdomain.com or https://www.yourdomain.com. Both can be secure, but choosing one avoids duplicate versions of the same page. Your redirect should send visitors to that one preferred version.

The easiest way to force HTTPS in cPanel

For many websites, cPanel’s built-in redirect tool is the simplest option. It does not require editing server files, which makes it a good starting point for first-time site owners.

From your cPanel dashboard, open Redirects in the Domains section. Choose Permanent (301) from the Type menu. A 301 redirect tells browsers and search engines that the old HTTP address has moved permanently to HTTPS.

Select your domain from the dropdown menu. In the redirect destination field, enter your preferred secure URL, such as https://yourdomain.com. Select the option to redirect with or without www based on the version you want visitors to see. If your website uses pages and posts, choose the setting that redirects individual paths as well. This keeps a visitor going to http://yourdomain.com/contact on the equivalent secure contact page, rather than sending everyone to the homepage.

Click Add to save the redirect. Then test it in a private or incognito browser window by entering an HTTP address manually. Check the homepage and at least one internal page.

When the cPanel Redirects tool is enough

The Redirects tool is a practical choice for a basic HTML site or a simple WordPress site with one domain. It is easy to reverse if needed and keeps the process approachable.

However, hosting setups vary. Some sites already have redirect rules in .htaccess, plugins that manage HTTPS, CDN settings, or domain forwarding at the registrar. Adding a second rule in cPanel can create unexpected behavior. If you already use custom redirects, review those first and use one clear method to handle HTTP-to-HTTPS traffic.

How to force HTTPS and redirect HTTP to HTTPS in cPanel with .htaccess

An .htaccess rule gives you more control, especially if you need to enforce both HTTPS and a preferred www or non-www domain. This file is usually located in your site’s document root, commonly the public_html folder for the main domain.

Before editing anything, make a backup. In cPanel, open File Manager, select the correct folder, and locate .htaccess. If you do not see it, open Settings in File Manager and enable Show Hidden Files. Download a copy before making changes.

To force HTTPS while keeping the domain format visitors already use, add this rule near the top of the .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Save the file and test HTTP URLs in a private browser window. This rule keeps page paths, query strings, and the existing domain name intact while moving the connection to HTTPS.

If you want every visitor to use the non-www version of your domain, use a combined rule instead. Replace yourdomain.com with your actual domain:

RewriteEngine On
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} !^yourdomain.com$ [NC]
RewriteRule ^ https://yourdomain.com%{REQUEST_URI} [L,R=301]

For a preferred www address, change the condition and destination to www.yourdomain.com. Your SSL certificate must cover the exact hostname you choose. A certificate for only yourdomain.com may not protect www.yourdomain.com unless it includes both names.

Do not place multiple competing HTTPS rules in the file. One rule for HTTPS and one separate rule for www can work, but a single combined rule is often easier to maintain and reduces extra redirect steps.

Update WordPress after enabling HTTPS

If you use WordPress, the server redirect is only part of the job. WordPress must also know that its permanent site address uses HTTPS.

In the WordPress dashboard, go to Settings > General. Confirm that both WordPress Address (URL) and Site Address (URL) begin with https://. Save the change. You may need to log in again afterward.

Next, clear any site cache, plugin cache, or browser cache. Visit several pages and look for a padlock icon in the browser address bar. If the page is secure but the browser still displays a warning, the site may have mixed content. This happens when images, scripts, fonts, or stylesheets still load from an HTTP address.

Mixed content is common on older sites. Update hard-coded http:// references in your theme settings, page builder content, or database. A WordPress plugin can help replace old URLs, but make a backup before changing database content. If you use a CDN or security service, make sure its SSL mode is compatible with your origin server’s certificate.

Avoid common redirect problems

The most common issue is a redirect loop. Your browser may report that the page redirected too many times. This usually means two systems are disagreeing about whether the visitor is already using HTTPS. For example, an .htaccess rule, a WordPress plugin, and a proxy service may all be trying to force HTTPS.

Start by removing duplicate rules and testing again. If your site runs behind a proxy or CDN, the server may receive traffic as HTTP even when the visitor is on HTTPS. In that case, a standard .htaccess rule may need adjustment. It depends on the service configuration, so support can help identify the correct setup without risking downtime.

Another common mistake is redirecting the wrong folder or domain. Add-on domains and subdomains may use their own document roots and their own .htaccess files. A rule placed in the main public_html folder may not control a site stored elsewhere.

Finally, use a 301 redirect only after you have confirmed the destination is correct. Browsers can cache permanent redirects aggressively. During testing, an incognito window helps, but clearing the browser cache may also be necessary after changes.

Test the secure version before moving on

After the redirect is active, test http://yourdomain.com, https://yourdomain.com, and any www version you do not use. They should all arrive at one preferred HTTPS address without warnings or repeated jumps.

Check a few important pages, including contact forms, login pages, checkout pages, and image-heavy posts. A secure URL should not come at the cost of broken styles, missing images, or form errors. If anything looks wrong, restore your .htaccess backup or remove the newest redirect and review the SSL and domain settings first.

A properly configured HTTPS redirect is mostly a set-it-and-forget-it task, but it is worth rechecking after a site migration, domain change, CDN setup, or major WordPress update. If you need a second set of eyes, Visiba support can help confirm that your certificate, DNS, and redirect rules are working together.