.htaccess 在“重写”状态下捕获组

.htaccess 在“重写”状态下捕获组,.htaccess,.htaccess,我有一条规则: RewriteCond %{QUERY_STRING} size=(\d+) 并希望捕获(\d+),以便以后在重写规则或重写条件中使用。大概是这样的: RewriteCond %{QUERY_STRING} size=(\d+) RewriteCond $1 <1024 ## that $1 refers to (\d+) RewriteCond%{QUERY\u STRING}size=(\d+) RewriteCond$1您需要使用%反向引用: RewriteCon

我有一条规则:

RewriteCond %{QUERY_STRING} size=(\d+)
并希望捕获
(\d+)
,以便以后在
重写规则
重写条件
中使用。大概是这样的:

RewriteCond %{QUERY_STRING} size=(\d+)
RewriteCond $1 <1024 ## that $1 refers to (\d+)
RewriteCond%{QUERY\u STRING}size=(\d+)

RewriteCond$1您需要使用
%
反向引用:

RewriteCond %{QUERY_STRING} size=(\d+)
RewriteCond ^ /%1 [L]
%1
在重写条件下反向引用以前捕获的组