To ensure all visitors access your website securely, you can configure your server to automatically redirect traffic from HTTP (http://) to HTTPS (https://). This guarantees encrypted communication and prevents browsers from showing “Not Secure” warnings.
Why Redirect to SSL?
-
Protects sensitive data (logins, payments, personal info).
-
Ensures visitors always use a secure connection.
-
Improves SEO rankings (Google favors HTTPS).
-
Prevents mixed‑content warnings in browsers.
Redirecting via .htaccess (Apache/LiteSpeed Servers)
-
Confirm that your domain has a valid SSL certificate installed.
-
In your site’s root directory, locate or create a
.htaccessfile. -
Add the following lines:
apache RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] -
Save the file. All HTTP requests will now redirect to HTTPS.
Redirecting via WHM/cPanel
-
WordPress Sites → Enforce SSL directly from the WordPress admin dashboard under Settings → General → Site URL.
-
cPanel Domains → Use Domains → Force HTTPS Redirect to enable automatic redirection for each domain.
-
WHM → Administrators can enforce SSL globally by editing Apache configuration or enabling HTTPS redirects at the account level.
Notes
|