在启用mod重写的情况下发送表单get时出现PHP问题


PHP Issues while sending form get with mod rewrite enabled

我有一个搜索功能来查找产品,而且我在.htaccess 中启用了mod重写

RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteRule ^([A-Za-z0-9_-]+)$ /index.php?go=$1
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ /index.php?go=$1&action=$2
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ /index.php?go=$1&action=$2&do=$3
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)$ /index.php?go=$1&action=$2&do=$3&id=$4

问题是,当我像https://www.server.com/search?search=try+search那样进行搜索时,它在进行时不会显示任何结果

echo $_GET['search'];

但如果我做https://www.server.com/?go=search&search=try+search,那么它可以完美地工作,所以我看到问题是重写,但我无法修复它。

有什么建议吗?

感谢

尝试将其添加到每个规则中:[QSA,L]

有关此处标志的更多信息:QSA,L