Apache mod-rewrite(RewriteRule) filter for https
<p>I want the user to redirect to <code>https</code>except specific <code>URL</code> pattern.
For example, if User types <code>sacyolo.com</code>, I want him to redirect to `<a href="https://sacyolo.com" rel="nofollow">https://sacyolo.com</a>  </p>

<p>But when user types sacyolo.com/api/....,`
 I don't want him to redirect to https.<br>
I tried   </p>

<pre><code> RewriteCond %{HTTP_HOST} ^sacyolo.com$ [NC]
    RewriteCond %{REQUEST_URI} !^/api(.*)$ [NC]
    RewriteRule ^(.*)$ https://sacyolo.com/$1 [R=301,L]
</code></pre>

<p>But it doesnt work.</p>