How to redirect the old http urls to https?

Hi, I’ve created the cert in my cPanel, and in config changed the site_value to https and it has converted all the old http shortened links to HTTPS in yourls admin panel. But how can I redirect the old http links traffic to HTTPS?

Thanks

EDIT:
Found the solution

# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS}  !=on              //Added this line//
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]
</IfModule>
# END YOURLS


<Files 403.shtml>
order allow,deny
allow from all
</Files>

Answered on https://github.com/YOURLS/YOURLS/issues/2578

Getting 404 Not Found error on https links now, http version is working fine though. Please any solid solution?

https://deal.ink/Grammarly

EDIT:

Made this change and it works, not sure how longer it gonna work. As yesterday the previous changes were working as well. but today when I tested the https version it starts giving me the 404 error.

Here’s the latest change:

# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]
RewriteCond %{HTTPS} =on           //Added this line here
</IfModule>
# END YOURLS


<Files 403.shtml>
order allow,deny
allow from all
</Files>