How to Force HTTPS on Your Website
Why Force HTTPS?
After installing SSL, your site is accessible via both http:// and https://. You should force all visitors to use HTTPS for security and SEO.
Method 1: DirectAdmin Setting
- Log in to DirectAdmin
- Go to Domain Setup (or Domain Management)
- Select your domain
- Enable Force SSL with HTTPS redirect
- Save
Method 2: .htaccess (Apache/nginx)
Create or edit the .htaccess file in your public_html folder:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTPHOST}%{REQUESTURI} [L,R=301]
Method 3: In Your Application
Most CMS platforms (WordPress, etc.) have settings to force HTTPS:
- WordPress: Go to Settings → General and change both URLs to
https://
Verify It Works
After enabling, test by visiting http://example.com — it should automatically redirect to https://example.com.
Was this article helpful?