我现在有这个规则:
RewriteRule ^/mp3/(.*)$ /music/$1 [L,R=301]
RewriteRule ^/activate/(.*) /index.php?p=activate.php&hash=$1 [QSA]
RewriteRule ^(.*)/([0-9]+)/(.*)$ index.php?p=$1&id=$2&page=$2 [QSA]
RewriteRule ^(.*)/([0-9]+)$ index.php?p=$1&id=$2&page=$2 [QSA]
RewriteRule ^(.*)/$ index.php?p=$1 [QSA]
但转移到 Nginx,我已经创建了这些规则,但现在工作,我只得到 404:
location / {
rewrite ^/mp3/(.*) /music/$1 permanent;
rewrite ^/activate/(.*) /index.php?p=activate.php&hash=$1 permanent;
rewrite ^(.*)/([0-9]+)/(.*)$ index.php?p=$1&id=$2&page=$2 break;
rewrite ^(.*)/([0-9]+)$ index.php?p=$1&id=$2&page=$2 break;
rewrite ^(.*)/$ index.php?p=$1 break;
}
如何将 QSA 规则转换为 Nginx?