Your SSL files may indeed be stored to a different filepath. If so, you will need a "copy" of the rules in that path's top .htaccess file as well.
Otherwise, be very sure that you've deleted your browser cache before testing any new server-side code. Otherwise, your browser will show you stale cached pages and server responses. "Forcing" a page reload is not sufficient in most cases -- delete the cache completely.
Your code itself does not 'look at' SSL versus non-SSL, and is correct as far as it goes. So it should invoke the redirects as you desire as long as it is located in a .htaccess file along the directory-path to the requested resource; Be very sure about your rule order if you have additional RewriteRules in this file. For that matter, problems may also be caused by mixing mod_alias directives with mod_rewrite, because in doing so, you lose control over directive execution order.
Should you wish to canonicalize the hostname without forcing https, you can use
RewriteCond %{HTTP_HOST} !^mydomain\.com$
RewriteCond %{SERVER_PORT}s ^(443(s)|[0-9]+s)$
RewriteRule ^(.*)$ http%2://mydomain.com/$1 [R=301,L]
That's got nothing to do with your current issue, though...
Jim