Securing your Osclass installation with an SSL certificate ensures that your website operates over a secure HTTPS connection, encrypting user data and improving SEO rankings. Follow these steps to properly configure SSL on your Osclass website.
Before configuring Osclass for HTTPS, ensure that your hosting provider has installed and activated an SSL certificate for your domain. A valid SSL certificate is required; otherwise, your website’s assets (CSS, JavaScript, images, etc.) may not load correctly.
config.phpOnce the SSL certificate is active, update your Osclass configuration to use HTTPS:
config.php file.WEB_PATH definition.https:// instead of http://. Example:define('WEB_PATH', 'https://yoursite.com/');
To force all traffic to use HTTPS, configure your .htaccess file. If it does not exist, create a blank file named .htaccess in the root directory of your Osclass installation.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.yourdomain.com/folder/$1 [R,L]
After implementing the redirect, test your site to ensure that it properly redirects all traffic to HTTPS.
config.php ProtocolIf you have set up SSL and configured redirection but forgot to update config.php, your site will load over HTTPS, but internal links to assets (images, CSS, JavaScript) may still use http://, causing them to break. Ensure WEB_PATH is correctly set to https://.
If you update config.php but your SSL certificate is not valid, Osclass will attempt to load assets over HTTPS, but browsers will block them. Ensure your certificate is correctly installed and functioning before updating the site configuration.
Once all steps are completed, your Osclass installation will be fully secured with HTTPS.