I've modified my Debian 9 installation (Apache 2.4.25) to allow HTTP/2 support.
I've successfully checked it online, and the pages do 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.
a2dismod php7.2 and mpm_prefork) and I enable a mpm module(a2enmod mpm_event, but I also tried mpm_worker) that supports HTTP/2. Is the mod_rewrite.c conditional below invalidated by loading the mpm_worker module? If so how do I replace it?
EDIT: a detailed Log show me this error: AH01071: Got error 'Primary script unknown\n', referer: https://sitename.com/brands/
My .htaccess (in the brands directory where index.php resides) which works fine with the previous configuration is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
<IfModule mod_headers.c>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
IndexOptions +Charset=UTF-8
My /etc/apache2/sites-enabled/default-ssl.conf relevant content includes:
<VirtualHost _default_:443>
# even without enabling here h2c or h2 I get the error
Protocols http/1.1
<Directory "/var/www/html">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
# since apache 2.4
Require all granted
</Directory>
</VirtualHost>
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:
apt-get install php7.2-fpm
a2enmod proxy_fcgi setenvif
a2enconf php7.2-fpm
The problem was because of an internal redirect. It is fixed now.
You have not configured PHP-FPM correctly. Disable that php-fpm configuration by saying a2disconf php7.2-fpm. And add the following in the httpd.conf file, this should work:
<FilesMatch "\.php$">
SetHandler "proxy:fcgi://localhost:9000"
</FilesMatch>
ProxyErrorOverride On
Restart Apache and PHP-FPM (PHP-FPM restart probably not required, but Apache must be restarted). Enable HTTP/2 now, it should work probably.
The OP had this problem from some redirect in the configuration.