这里,如果是单次重定向用 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; }
........................ } |