There are 3 steps you should do to completely setup SSL certificate on your installation.

Create or activate SSL certificate

Very first step is to activate SSL certificate on your site. Make sure certificate is valid and functional, otherwise all assets on your website (css, js, img, …)

Update website URL in config.php to use https

Go to file config.php located in root directory of your Osclass installation.

Update constant WEB_PATH and make sure it use https:// instead of http://. Example

define('WEB_PATH', 'https://yoursite.com/');

Create redirect in .htaccess file (optional)

This step is optional, because it can also be defined from hosting settings (or i.e. cloudflare settings) to force https connection.

Anyway, objective is to redirect all cached URLs (i.e. in user browsers, search engines, …) to use safe version of your site that use https protocol.

There are multiple alternatives and tutorials you may use to setup redirect in htaccess.

Now, go to file .htaccess located in root Osclass installation directory (it may not be visible, or may not exists yet. If it does not exists, create blank one) and place to file following code (select your alternative):

Alternative #1:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
[L,R=301]
</IfModule>


Alternative #2 (redirect all web traffic):

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]


Alternative #3 (redirect only specific domain):

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]


Alternative #4 (redirect only specific folder):

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]

That’s it, test your site and make sure everything works as expected!