如何在nginx中编写配置以将以下网址重写:domain.com/index.php?page=home
到domain.com/index.php?page=m-home
答案 0 :(得分:1)
if ($args ~* (.*)(page=home)(.*)){
set $args $1page=m-home$3;
}
答案 1 :(得分:-1)
rewrite ^/index.php?page=m-(.*) /index.php?page=$1 last;
答案 2 :(得分:-1)
rewrite ^/index.php?page=(.+?)&(.*)$ /index.php?page=m-$1&$2 break;