How to enable SSL for Joomla using .htaccess?

How to enable SSL for Joomla using .htaccess?

You can force an HTTPS connection on your Joomla! website by adding the following lines in the .htaccess file of your application.

RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [QSA,R=301,L]
<IfModule !mod_ssl.c>
Redirect permanent / https://www.yourdomainname.com

Make sure that you replace www.yourdomainname.com with your actual domain name.

You can modify the .htaccess file (or recreate it if missing) with the File Manager in cPanel and add these lines at the top of the file.

This will force every request to your website to go through an HTTPS/SSL connection.

Share This Article