RewriteEngine On

RewriteCond %{HTTP_HOST} ^(.*)\.com$ [NC]
RewriteCond %{HTTPS} =off
RewriteRule (.*) http://%1.co.uk$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^(.*)\.com$ [NC]
RewriteCond %{HTTPS} =on
RewriteRule (.*) https://%1.co.uk$1 [R=301,L]