Force HTTPS via .htaccess - SSL Activation Guide

What is Force HTTPS?

Force HTTPS ensures that all visitors to your website connect via the secure HTTPS protocol instead of HTTP.
This way:

  • Data security is strengthened.

  • Mixed content warnings are prevented.

  • SEO is improved, as Google prefers HTTPS websites.


How to enable it with .htaccess

  1. Connect to your server via FTP or File Manager (cPanel).

  2. Go to the public_html.

  3. Open or create the .htaccess.

  4. Add the following code:

 
# Force https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# END Force https
  1. Save the file.

  2. Try opening your website. If everything has been set up correctly, it will automatically redirect to HTTPS.


Important Notes

  • You must have a valid SSL certificate installed.

  • If you use WordPress, Joomla or another CMS, make sure that the domain settings (site URL) are also set to HTTPS.

  • If you use a CDN (e.g. Cloudflare), check whether a corresponding setting is needed there too.


Frequently Asked Questions (FAQ)

1. What happens if I do not have an SSL certificate?
The website will not load correctly and visitors will see the error message “Your connection is not private”.

2. Do I have to pay for SSL?
Not necessarily. At Konet, all hosting plans come with free Let’s Encrypt SSL.

3. Can I use www and https together?
Yes. If you also want to enforce www, you can add an extra rule to .htaccess so that it redirects to https://www.yourdomain.com.

4. Will my SEO be affected?
Positively. Google has confirmed that HTTPS is a ranking factor. In addition, visitors feel more trust.

5. How do I check that everything works correctly?

  • Visit your website with http:// → it should redirect to https://.

  • Use the Why No Padlock? tool to check for possible mixed content issues.


At Konet we provide automatic SSL installation and support for HTTPS settings, so you do not have to worry about technical details.

 

Was this article helpful?

Related service Konet Web Hosting cPanel, LiteSpeed and automatic backups on every plan.

Related articles