If you have installed SSL Certificate on your website and want to redirect your website traffic from http to https using .htaccess then you need to add the below code to your .htaccess file for the redirection.
Redirecting HTTP to HTTPS
Add the following line to your .htaccess, if you are looking to redirect a specific domain from HTTP to HTTPS.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Add the following line to your .htaccess, if you are looking to redirect a specific folder from HTTP to HTTPS.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} folder
RewriteRule ^(.*)$ https://www.example.com/folder/$1 [R,L]
Note: You will need to replace example.com with your domain where required in your code and set the folder name where it is required.