nginx 网页跳转

当你让 你的旧网页 跳转到新网页去 防止访问流失
你可以用nginx 网页跳转 www.old.com 跳到 www.new.com

  1. 下载nginx
  2. 修改配置文件
    vim /usr/local/nginx/conf/nginx.conf
    修改内容
    server {
    listen 80;
    server_name localhost:
    }
    localhost / {

            root        html;
    
           index index.html    index.htm;
           rewrite     old.html   new.html  redirect;     
       }
    
      3.重起服务/usr/local/nginx/sbin/nginx -s reload
      4.ok    啦
    
                 曾经我们公司网站被封了!改动字段   又可以把访客留住了
    
                 server {
                          listen 80;
                         server_name  localhost;
                                 rewrite   ^/(.*)$  http://www.whatav.com/$1;
    
                            }
    
                                    localhost / {
                                                         index www.xo.com  www.xxoo.com
    
                                                        }