If you want to rewrite a URL to https in the same virtualhost that you run http, you can add the flag RewriteCond %{HTTPS} !=on, like this:
If you want to rewrite a URL to https in the same virtualhost that you run http, you can add the flag RewriteCond %{HTTPS} !=on, like this: