To make sure that the visitors of your website use an encrypted SSL / HTTPS connection, you must include a snippet of code in the .htaccess file of your website.
If you don't have an SSL certificate yet and / or have not yet installed it, you can consult the article Install SSL certificate.
When the SSL certificate is installed and the SSL connection works via https://www.yourdomain.uk you can make sure that all the traffic from https://www.yourdomain.uk is automatically forwarded to http://yourdomain.uk in order to force a secure SSL connection.
How do I force a secured SSL / HTTPS connection for my domain?
To make sure that all users uses the secured SSL / HTTPS connection, place the following lines of code in the .htaccess file located in the folder /domains/yourdomain.uk/public_html folder via FTP or the file manager of DirectAdmin.
##------Force HTTPS connection entire domain------##
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
##
How do I force an SSL / HTTPS connection for a sub folder of my domain?
In addition to forcing a secured connection on the entire domain, you can also force a certain part of your domain. For instance, when you have installed a web shop at 'www.yourdomain.uk/webshop/" it is possible to only force a secured SSL / HTTPS connection for this folder. To this end, you must insert the code below into the .htaccess file placed in that specific folder:
##-------Force HTTPS connection of a folder-------##
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?webshop/(.*) https://%{SERVER_NAME}/webshop/$1 [R,L]
##
Please note! Make sure that the words 'webshop' in the code above are changed to the name of the folder of which you wish to force an SSL connection.
Force SSL/HTTPS connection for Wordpress
To force a secure SSL / HTTPS connection for visitors of your Wordpress website you have to install and activate the 'Really Simple SSL' through your Wordpress admin after your SSL certificate has been installed.
This Wordpress plugin will force all your pages automatically to https://
Force SSL/HTTPS connection for Joomla
To force a secure SSL / HTTPS connection for visitors of your Joomla website you have to follow the next staps:
1. Login to Directadmin.
2. Open the Filemanager and go to /domains/yourdomain.uk/public_html
3. Click on edit at the 'configurations' file.
4. Search the following line:
var $ live_site = ' '
5. Change it to:
var $ live_site = 'https://www.yourdomain.uk'
6. Click on 'Save'.
7. Click on edit at the '.htaccess' file.
8. Add the following lines to the top of the file:
RewriteEngineOn
RewriteCond%{HTTPS} OFF
RewriteRule(.*) https://%{HTTP_HOST}%{REQUEST_URI}
9. Click 'Save'.
10. Login to your Joomla Administrator panel.
11. Go to 'System >> Global configuration'.
12. Select at force SSL 'Entire website'.
13. Click on 'Save'.
Force SSL/HTTPS connection for Magento
To force a secure SSL / HTTPS connection for visitors of your Magento website you have to follow the next staps:
1. Login to your Magento backend.
2. Go to 'System >> Configuration'.
3. Click at the left side at 'Web'.
4. Change the following:
'Base-URL' to 'https://www.yourdomain.uk'
'Use Secure URLs in Frontend' to 'Yes'
'Use Secure URLs in Admin' to 'Yes'
5. Click on 'Save'