nginx 常见参数以及重定向参数配置(摘抄)

  1、参考

  nginx 常见参数以及重定向参数配置

  2、nginx 各参数翻译,作用

  rewrite ^/test.php /new permanent; //重写向带参数的地址

  rewrite ^/test.php /new? permanent; //重定向后不带参数

  rewrite ^/test.php /new?id=$arg_id? permanent; //重定向后带指定的参数

  permanent是永久重定向参数,根据需要去掉也可以,不过最好是带有。

  参考301重定向与302重定向的区别