To ensure visitors always use a secure connection (HTTPS), follow these steps:

Method 1: Using .htaccess (Apache Servers)

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

Method 2: Using cPanel Redirects

  1. Log in to cPanel.
  2. Go to Domains > Redirects.
  3. Create a permanent 301 redirect from http://yourdomain.com to https://yourdomain.com.

Method 3: Cloudflare Page Rules

If using Cloudflare, set a Page Rule to always use HTTPS:

  • Go to Cloudflare dashboard.
  • Navigate to Page Rules.
  • Create a rule for http://*yourdomain.com/* to Always Use HTTPS.