That turned out to be very very simple.
First you need to have some SSL certificate installed, but luckily my hosting provider had already installed AutoSSL and it was already active.
If you like me have MyBB forum then you need to go to
Home >> Board Settings>>General Configuration
And change in the field: Board URL http to https.
Finally, in your htaccess file you need to write:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
And that was all.
First you need to have some SSL certificate installed, but luckily my hosting provider had already installed AutoSSL and it was already active.
If you like me have MyBB forum then you need to go to
Home >> Board Settings>>General Configuration
And change in the field: Board URL http to https.
Finally, in your htaccess file you need to write:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
And that was all.