Today, I have been wondering what the scope of Apache rewriterule pattern is. From the Apache rewrite configuration of my company, I think it works on Uri. But I see the http://lamp.linux.gov.cn/Apache/ApacheMenu/mod/mod_rewrite.html (APACHE Chinese Reference Manual), which is written as follows:
PatternIs a Perl-Compatible Regular Expression acting on the current URL. "Current URL" refers to the value of the URL when the rule takes effect. It may be different from the requested URL, because other rules may have been matched before and modified.
In this section, I understand that pattern applies to URLs, that is, QUERY_STRING. This made me puzzled, and finally I went to the Apache official website to see (http://httpd.apache.org/docs/current/mod/mod_rewrite.html), found that the pattern scope should initially be URL-path (similar to Uri, is there any difference?) the original article is as follows:
PatternIs a Perl Compatible
Regular Expression. On the first rewriterule it is applied to the (%-decoded)
URL-path of the request; subsequent patterns are applied to the output of the last matched rewriterule.
I found that there are some differences between Chinese reference documents and Apache official English documents, so I suggest you try your best to refer to the original English version for explanations when you encounter problems.