1. 程式人生 > >nginx 網頁跳轉

nginx 網頁跳轉

rect roo root reload 服務 name 配置文件 htm 訪問

當你讓 你的舊網頁 跳轉到新網頁去 防止訪問流失
你可以用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    啦

nginx 網頁跳轉