title: How to enable mod_redirect in htaccess over HTTP/2
body: <p>I've modified my Debian 9 installation (Apache 2.4.25) to allow HTTP/2 support. </p>
  
  <p>I've successfully checked it online, and the pages <em>do</em> serve, but the problem lies with the redirection performed in .htaccess to map for example site.com/index.php/brands/mybrand to a nice url (site.com/brands/mybrand). It simply does not happen. This is a Codeigniter setup.</p>
  
  <ul>
  <li>The problematic steps seem to be when I disable the current modules (<code>a2dismod php7.2</code> and <code>mpm_prefork</code>) and I enable a mpm module(<code>a2enmod mpm_event</code>, but I also tried <code>mpm_worker</code>) that supports HTTP/2. </li>
  <li>At that point I get "file not found" (404 error)</li>
  <li>By reverting those two steps I get back to normal (no HTTP/2 of course)</li>
  </ul>
  
  <p>Is the mod_rewrite.c conditional below invalidated by loading the mpm_worker module? If so how do I replace it?</p>
  
  <blockquote>
    <p>EDIT: a detailed Log show me this error:
    AH01071: Got error 'Primary script unknown\n', referer: <a href="https://sitename.com/brands/" rel="nofollow noreferrer">https://sitename.com/brands/</a></p>
  </blockquote>
  
  <p>My .htaccess (in the brands directory where index.php resides) which works fine with the previous configuration is:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php/$1 [L]
      RewriteCond %{HTTPS} !on
      RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
  &lt;/IfModule&gt;
  
  &lt;IfModule mod_headers.c&gt;
    &lt;FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$"&gt;
      Header set Access-Control-Allow-Origin "*"
    &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  IndexOptions +Charset=UTF-8
  </code></pre>
  
  <p>My /etc/apache2/sites-enabled/default-ssl.conf relevant content includes:</p>
  
  <pre><code>&lt;VirtualHost _default_:443&gt;
           # even without enabling here h2c or h2 I get the error
           Protocols http/1.1
           &lt;Directory "/var/www/html"&gt;
                   Options Indexes FollowSymLinks MultiViews
                   AllowOverride All
                   # since apache 2.4
                    Require all granted
           &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Note: Other commands that I previously run to enable additional modules required are these ones below. I didn't have to touch anything of this to revert back to a working (non HTTP/2) configuration:</p>
  
  <pre><code>apt-get install php7.2-fpm
  a2enmod proxy_fcgi setenvif
  a2enconf php7.2-fpm
  </code></pre>
  
  <h2>Edit:</h2>
  
  <p>The problem was because of an internal redirect. It is fixed now.</p>