After upgrading to Apache 2.4.56, a URL subject to a rewrite rule in .htaccess throws a 403 error. Errors similar to the following are also found in the Apache error log.
[Mon Mar 13 12:06:56.569311 2023] [rewrite:error] [pid 13123] [client 203.0.113.2:0] AH10411: Rewritten query string contains control characters or spaces
A change was made in Apache 2.4.56 to the way rewrite rules are parsed.
Add the "B" option to the rewrite rule.
RewriteRule ^(.*)$ index.php?/$1 [B,L]