SSL & HTTPS

How can I redirect http to https?

Updated November 2026 10,608 views 3 min read
SSL & HTTPS | Updated November 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

Frequently Asked Questions

How do I redirect HTTP to HTTPS?

The easiest way is cPanel's Force HTTPS Redirect under Domains, which toggles the redirect on for you. You can also add a rewrite rule to .htaccess that sends all http requests to https. Do this after your SSL certificate is active.

What is the .htaccess rule to force HTTPS?

Add a RewriteCond %{HTTPS} off with a RewriteRule redirecting to https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] at the top of your document-root .htaccess. The 301 makes it a permanent redirect that search engines respect.

Why do I see mixed-content warnings after switching to HTTPS?

Because some page resources (images, scripts, stylesheets) are still linked with http URLs. Update those links to https or protocol-relative paths. In WordPress, set the Site and Home URLs to https and run a search-replace to fix hardcoded http links.

Do I need to redirect to HTTPS for SEO?

Yes, it is best practice. Serving one canonical https version with a 301 from http avoids duplicate URLs, is a positive ranking signal, and is required for the padlock and modern browser features. UWH AutoSSL provides the certificate for free.

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 November 2026 · Browse all SSL articles

Share: X in Reddit f Email
  • 503 Users Found This Useful

Was this answer helpful?

Related Articles

ERR_TOO_MANY_REDIRECTS: Fixing the Redirect Loop After Enabling SSL or Cloudflare

SSL & HTTPS | Updated November 2026 The "ERR_TOO_MANY_REDIRECTS" error (also shown as...

htaccess - Allow Let's Encrypt to Validate and Renew

SSL & HTTPS | Updated March 2026 If Let's Encrypt cannot validate your domain because of...

FileZilla GnuTLS Error and Could Not Connect to Server Over FTPS

FTP | Updated November 2026 A "GnuTLS error" or "Could not connect to server" message in...

Installing an SSL Certificate in cPanel

SSL & HTTPS | Updated November 2026 Ultra Web Hosting includes free Let's Encrypt SSL...

How to Fix Mixed Content Warnings After Enabling SSL

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



Save 30% on web hosting - Use coupon code Hosting30