title: I can't apply two rules at the same time in htaccess
body: <p>and thanks to read me.
  My goal is to have the same htaccess code in local and production.
  First, I need to rewrite example.com/index.php?action=somepage to example.com/somepage.
  Second, I must rewrite <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>, but only in production, not on localhost.
  So far this is my code:</p>
  <pre><code>RewriteEngine on
  RewriteBase /
  # For Ionos
  RewriteRule ^([0-9a-zA-Z/\ -]+)(?:&amp;([0-9a-zA-Z&amp;=_\ -]+))?$ index.php?action=$1&amp;$2
  # $1 : route name and framework parameters
  # $2 : classic $_GET parameters (&amp;param=value)
  RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=301]
  </code></pre>
  <p>When I use https:// to connect, no problem, the first rule concerning index and action apply.
  When I use http://, the adress become https://, BUT the index/action rule doesn't apply.</p>
  <p>Thanks a lot!</p>
  <p>Edit : this works :</p>
  <pre><code>RewriteEngine on
  RewriteBase /
  RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
  RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,R=301]
  # For Ionos, http =&gt; https
  RewriteRule ^([0-9a-zA-Z/\ -]+)(?:&amp;([0-9a-zA-Z&amp;=_\ -]+))?$ index.php?action=$1&amp;$2
  # $1 : route name and framework parameters
  # $2 : classic $_GET parameters (&amp;param=value)
  </code></pre>
  <p>But I have a last problem.
  My folder in like this:</p>
  <pre><code>[] example
  ...[]public
  ......htaccess
  ...htaccess
  </code></pre>
  <p>The code shown above is the htaccess of public directory. The htaccess of example directory redirect to public:</p>
  <pre><code>RewriteEngine on
  RewriteBase /
  # for Ionos
  RewriteCond %{REQUEST_URI} !^public
  RewriteRule ^(.*)$ public/$1 [L]
  </code></pre>
  <p>The problem is while <a href="http://example.com" rel="nofollow noreferrer">http://example.com</a> redirect to <a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>, <a href="http://example.com/somepage" rel="nofollow noreferrer">http://example.com/somepage</a> redirect to <a href="https://example.com/public/somepage" rel="nofollow noreferrer">https://example.com/public/somepage</a> and I can't remove the &quot;public&quot; part.</p>
  <p>Thanks!</p>