Forcing HTTPS on Your Website

Once you have an SSL certificate installed on your domain, the next step is to ensure that all visitors access your site over a secure HTTPS connection. Without a redirect in place, visitors can still reach your site via plain HTTP, which means their data is transmitted unencrypted. Forcing HTTPS ensures every request is automatically redirected to the secure version of your website.

Browser showing secure HTTPS connection with padlock

Why Force HTTPS?

  • Data protection: All information exchanged between the browser and server is encrypted.
  • SEO benefits: Search engines favor HTTPS websites in their rankings.
  • Trust signals: Visitors see a padlock icon, increasing confidence in your site.
  • Compliance: Many regulations and payment processors require HTTPS for handling sensitive data.

Method 1: .htaccess Redirect Rules

This is the most common approach for Apache-based hosting. Connect to your hosting account via cPanel File Manager or FTP and edit the .htaccess file located in your public_html directory. Add the following lines at the top of the file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

This creates a permanent (301) redirect from HTTP to HTTPS for all pages on your site. Save the file and test by visiting http://yourdomain.com in your browser. You should be redirected to https://yourdomain.com automatically.

If your site is in a subdirectory, make sure the .htaccess file is in the correct directory for the redirect to apply.

Method 2: cPanel Force HTTPS Redirect

CyclebreezeHost cPanel includes a built-in option to force HTTPS without manually editing files:

  1. Log in to cPanel.
  2. Navigate to the Domains section.
  3. Locate your domain in the list.
  4. Toggle the Force HTTPS Redirect switch to the on position.

This method applies the redirect at the server level and is the simplest option for most users.

WordPress-Specific Settings

For WordPress websites, take these additional steps after enabling the redirect:

  1. Log in to your WordPress admin dashboard.
  2. Go to Settings > General.
  3. Change both the WordPress Address (URL) and Site Address (URL) fields from http:// to https://.
  4. Click Save Changes.

If you are locked out after making this change, you can update the URLs directly in the database using phpMyAdmin by editing the siteurl and home values in the wp_options table.

Testing Your Configuration

After enabling the redirect, test thoroughly:

  • Visit http://yourdomain.com and confirm it redirects to https://yourdomain.com.
  • Check several internal pages to ensure redirects work site-wide.
  • Use your browser developer tools (F12) to look for any insecure requests.

Fixing Mixed Content

Mixed content occurs when your HTTPS page loads resources over HTTP. Common culprits include hardcoded image URLs, external scripts, and embedded content. To fix this:

  • Search your database and theme files for http://yourdomain.com and replace with https://yourdomain.com.
  • Use a WordPress plugin like Better Search Replace to update URLs in the database.
  • Ensure third-party embeds and scripts use HTTPS or protocol-relative URLs.

Resolving mixed content ensures visitors see a full padlock icon with no browser warnings.