Installing SSL certificate in PrestaShop
Learn how to install an SSL certificate in PrestaShop, ensuring automatic redirection to HTTPS and encryption of data between users and the server.
Introduction
In this tutorial, we will present the necessary steps to implement an SSL certificate in the PrestaShop application, using the settings available in the administration section of the application. After completing these steps:
- Any unsecured access to the website (e.g. https://domain.tld) will be automatically redirected to the secured version (e.g. https://domain.tld).
- All data transferred between users and the server will be encrypted.
As an example, we will use the subdomain demo.hostico.ro.
Requirements
To go through this process, you need:
- The authentication data for the PrestaShop administration panel.
- An SSL certificate installed on the hosting account for the domain where the PrestaShop application is running.
Steps
- Log in to the PrestaShop admin panel by accessing
domain.tld/AdminAddress
(the custom address during installation).
- Navigate to Configure → Shop Parameters → General.
- In the general settings interface, check if the domain supports HTTPS by clicking on Please click here to check if your shop supports HTTPS.
- If no errors occur, activate the Enable SSL and Enable SSL on all pages fields by setting them to On.
- If the application does not allow activating both fields simultaneously:
- First, set Enable SSL to On and save the changes.
- After reloading the page, enable Enable SSL on all pages, then save again.
After completing these steps, all insecure accesses will be redirected to HTTPS, and the site's resources will be loaded through the secure protocol.
Redirects via the .htaccess file
If the redirection to HTTPS does not occur automatically, edit the .htaccess
file of the PrestaShop application and add the following lines at the end:
RewriteEngine On
RewriteCond %{HTTPS} offRewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
The .htaccess
file can be edited from the File Manager in cPanel. If you do not see the file, enable the display of hidden files in the File Manager.
Security errors displayed in the browser
In certain cases, the browser may display warnings that the site is unsecured (e.g., a "yellow lock"). These do not represent issues with the SSL certificate, but arise from resources that continue to load via HTTP.
- Open the page source (right-click → View Page Source).
- Search for HTTP links using Ctrl + F and manually change those links to use HTTPS.
- Links may be present in the PHP code, database, or application settings/modules/preferences.