为什么 .htaccess mod 重写规则没有激活?

Why is .htaccess mod rewrite rule not activating?

我的 .htaccess 文件中有以下两条规则:

RewriteRule ^vacancies/test-feed/vacancies/status?user=(.*)$ vacancies/test-feed.php?mode=status&email= [L,NC]
RewriteRule ^vacancies/test-feed/vacancies/(.*)$ vacancies/test-feed.php?mode=vacancy-info&job_id= [L,NC]

我正在访问网址:

/vacancies/test-feed/vacancies/status?user=test@email.com

我希望它激活最高规则,但它实际上是激活第二个规则并将 status?user=test@email.com 作为

传递

如有任何帮助,我们将不胜感激。

尝试将第一条规则替换为:

RewriteCond %{QUERY_STRING} user=([^&]+) [NC]
RewriteRule ^vacancies/test-feed/vacancies/status$ vacancies/test-feed.php?mode=status&email=%1 [L,NC]