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
    
                                                        }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章