Enabling SSL certificate in Magento

In order to enable the SSL certificate and enable access to the website via https (green padlock), you must perform the following operational steps: Log in to the ‘back-end’ of our webesite (www.clients-domain.smarthost.eu/admin, where clients-domain.smarthost.eu is supposed to be replaced with your common domain and ‘admin’ is supposed to be replaced with the given panel login path).

1. Go to the “Stores” tab in the navigation bar

2. Click “Configuration”


3. Go to the “Web” tab

4. Check whether in the “Secure base URL” field your domain contains the https protocol

5. In the fields: “Use Secure URLs on Storefront” and “Use Secure URLs in Admin”, select “YES”

There is also an alternative method but it is not recommended due to compliactions that may arise after modifying the .htaccess file.

This method can be used by advanced users at their own risk. If there are RewriteCond and RewriteRule rules in the .htaccess file, try adding the rule:

RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$

The rule above is responsible for redirecting to https or to the index.php file. An example configuration of the .htaccess file with addtional rules already inserted may look like this:

 
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$ 
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

We would like to remind You that at Smarthost.eu, each hosting account automatically receives free SSL certifictes for all the domains.

Damian Koćwin
Latest posts by Damian Koćwin (see all)

Leave a Reply