1
我想用参数301将一个特定的URL重定向到另一个具有新参数的特定URL。NGINX用参数重写一个带有参数的URL到另一个带有新参数的URL
https://www.example.com/index.php?id=329
到
https://www.example.com/index.php?eID=dd_googlesitemap
我试过的东西,但我觉得有几个错误。
location = /index.php?id=329 {
rewrite^https://www.example.com/index.php?eID=dd_googlesitemap permanent;
}
OR
location = /index.php {
if ($arg_id = "329") {
rewrite^https://www.example.com/index.php?eID=dd_googlesitemap permanent;
}
}
OR
location = /index.php {
if ($args ~ "id=329") {
rewrite^https://www.example.com/index.php?eID=dd_googlesitemap permanent;
}
}
谁能帮助?
谢谢!