当我重构我的站点时,我有许多在.htaccess中的重定向。现在我想为nginx重新创建它们。以下是等效样式吗?哪种样式更有效?
# Style A
location / {
location /foo/123/old {
rewrite ^(.*) /bar/123/ permanent;
}
location /baz/456/old {
rewrite ^(.*) /bar/456/ permanent;
}
}
# Style B
location / {
rewrite ^/foo/123/old\/?$ /bar/123/ permanent;
rewrite ^/baz/456/old/\/?$ /bar/456/ permanent;
}