这里,如果是单次重定向用 redirect, 如果永久跳转用 permanent,这里用 permanent

 {

               listen       80;

               server_name  xxx.com www.xxx.com;

               index index.html index.php;

               root  /data/www/wwwroot;

               if ($http_host !~ "^www.xxx.com$") {

                       rewrite  ^(.*)    http://www.xxx.com$1 permanent;

                 }

              

               ........................

       }

相关文章:

  • 2022-02-11
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2021-09-17
  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
相关资源
相似解决方案