Apache重写规则删除查询字符串


Apache rewrite rule deletes query string

我正在尝试重写URL,以便它们在Apache中没有index.php。到目前为止,一切都很好,但我需要在GET请求中发送querystring参数,并意识到它们被剥离了。我正在使用QSA标志,但它不起作用,我的查询字符串永远无法到达服务器。

<VirtualHost noomo.jp:443>
DocumentRoot /var/www/noomo-web/public
<Directory "/var/www/noomo-web/public">
AllowOverride All
Options -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L,QSA]
</Directory>
SSLCertificateFile /etc/letsencrypt/live/noomo.jp/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/noomo.jp/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ServerName noomo.jp
</VirtualHost>

我是否缺少传递查询字符串所需的内容?我在谷歌上找了很多,但我能找到的都是基于查询字符串的重定向,而不是确保查询字符串通过。我以前在nginx服务器上也遇到过同样的事情,但我不知道如何在Apache上修复它。

啊!找到了!好吧,我要回答我自己的问题,这样人们就会看到,如果他们用谷歌搜索同样的问题,因为我花了几个小时才意识到。。。显然,你不能在条目中进行重写,否则它们将无法正常工作。我把重写规则移出来,放在条目里,现在就可以了。