我对 htaccess rewrite_mode 有疑问。当我在这些规则中使用多个 $_GET 变量时,第一个变量获取作为第一个 $_GET 变量的名称文件。请帮我。
RewriteEngine on
RewriteBase /ts/
RewriteRule ^(.+)/$ ts.php?a=$1 [C]
RewriteRule ^(.*)/(.+)/$ ts.php?a=$1&b=$2 [C]
RewriteRule ^(.*)/(.*)/(.+)/$ ts.php?a=$1&b=$2&c=$3 [C]
RewriteRule ^(.*)/(.*)/(.*)/(.+)/$ ts.php?a=$1&b=$2&c=$3&d=$4 [C,L]
这是“localhost/ts/1/”的输出
Array ( [a] => 1 )
这是“localhost/ts/1/2/”的输出
Array ( [a] => ts.php [b] => 2 )
这是“localhost/ts/1/2/3/”的输出
Array ( [a] => ts.php [b] => 2 [c] => 3 )
这是“localhost/ts/1/2/3/4/5/6/”的输出
Array ( [a] => ts.php/2/3 [b] => 4 [c] => 5 [d] => 6 )