How can I redirect http to https?

SSL & HTTPS | Updated 2026

After installing an SSL certificate on your site, you need to redirect all HTTP traffic to HTTPS so visitors always use the secure version. Ultra Web Hosting servers include an automatic HTTPS redirect option, but you can also do it manually via .htaccess.

01. Method 1: cPanel Force HTTPS (Easiest)

  1. Log into cPanel at my.ultrawebhosting.com
  2. Go to Domains > Domains
  3. Find your domain in the list
  4. Toggle "Force HTTPS Redirect" to ON

This creates an nginx-level redirect that is faster than .htaccess because it is processed before Apache even sees the request.

02. Method 2: .htaccess Redirect

If you prefer to control the redirect yourself (or need custom rules), add this to the top of your .htaccess file in public_html:

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

This issues a 301 (permanent) redirect from HTTP to HTTPS for all pages. The 301 tells search engines to update their index to the HTTPS version.

Tip

If you also want to force the www or non-www version at the same time, see our Complete Guide to .htaccess which covers combined www + HTTPS redirects. Also see Nginx and .htaccess Redirect Issues if you notice redirect loops when using .htaccess on our servers.

03. WordPress: Update Site URLs

For WordPress sites, the redirect alone is not enough. You also need to update the site URLs in WordPress settings:

  1. Log into WordPress Admin
  2. Go to Settings > General
  3. Change both "WordPress Address (URL)" and "Site Address (URL)" from http:// to https://
  4. Click "Save Changes"

If you are locked out after this change (redirect loop), you can fix it by editing wp-config.php and adding:

define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');

04. Fix Mixed Content Warnings

After enabling HTTPS, your browser may show a "Not Secure" warning or a broken padlock if your pages load some resources (images, scripts, stylesheets) over plain HTTP. This is called "mixed content."

We have a detailed guide on fixing this: How to Fix Mixed Content Warnings After Enabling SSL

The short version: search your database and theme files for http:// references and replace them with https://. For WordPress, the "Better Search Replace" plugin makes this easy.

Need Help With SSL?

If you need an SSL certificate installed or are having issues with HTTPS redirects, our team can help.

Open a Support Ticket

Quick Recap

  1. Use cPanel's Force HTTPS toggle - Domains > Domains, flip the switch
  2. Or use .htaccess - RewriteRule with R=301 for a permanent redirect
  3. Update WordPress URLs - Settings > General, change both to https://
  4. Fix mixed content - Replace http:// references in your database and theme
  5. 301 redirects are permanent - Search engines will update to the HTTPS version

Securing your website with HTTPS · Last updated March 2026 · Browse all SSL articles

  • 503 Users Found This Useful

Was this answer helpful?

Related Articles

Installing an SSL Certificate in cPanel

To start, the website requires a dedicated IP. If you do not have one, you may order the...

htaccess - Allow Let's Encrypt to Validate and Renew

When receiving the following Let's Encrypt error message:domain.com: The SSL certificate expires...

connection failed for acme-v01-api-letsencrypt org: SSL connect attempt failed

Let's Encrypt SSL Connection Error   If you see the error "connection failed for...

How to Fix Mixed Content Warnings After Enabling SSL

SSL & HTTPS | Updated March 2026 Mixed content warnings happen when your website loads...

SSL Certificates and HTTPS on Your Website

SSL & HTTPS | Updated March 2026 Yes. Every Ultra Web Hosting account includes free SSL...



Save 30% on web hosting - Use coupon code Hosting30