nginx的內頁跳轉總結

  剛進公司的時候老大一直在要求php做內頁跳轉,當時也不太瞭解細節所以一直沒有說話。後來php問我你會不會做內頁跳轉,我說會一點就做了幾個,從此搞內頁跳轉搞了兩個星期。至於爲什麼做內頁跳轉哪就暫時不說那麼多了,不知道的可以百度一下也可以谷歌。

    以下是內頁跳轉的要求:

www.5i1show.com/jiank/meir/1-0-0-0跳轉到www.5i1show.com/jiank/meir/1-0-0-0/

在配置文件里加入5i1show.com.conf

rewrite ^/invest/edai/(\d\-\d\-\d\-\d)$  /invest/edai/$1/       permanent;

如果是第一頁跳到主頁面也可以這樣

        rewrite ^/invest/dai/(\d\-\d\-\d\-\d\-p\d)$  /invest/dai/$1/     permanent;

www.5i1show.com/invest/welcome跳轉到www.5i1show.com/invest/

rewrite ^/invest/welcome /invest/ permanent;

www.5i1show.com/tools跳轉到www.5i1show.com/tools/

        rewrite ^/tools$ /tools/ permanent;

www.5i1show.com/article/index/cid/3跳轉到www.5i1show.com/article/help/

        rewrite ^/article/index/cid/3 /article/help/ permanent;

www.5i1show.com/article/index/cid/4跳轉到www.5i1show.com/article/notice/

        rewrite ^/article/index/cid/4 /article/notice/ permanent;

www.5i1show.com/article/index/cid/5跳轉到www.5i1show.com/article/media/

        rewrite ^/article/index/cid/5 /article/media/ permanent;

www.5i1show.com/article/notice/p1/跳轉到www.5i1show.com/article/notice/

        rewrite ^/article/notice/p1/ /article/notice/ permanent;

www.5i1show.com/article/media/p1/跳轉到www.5i1show.com/article/media/

        rewrite ^/article/media/p1/ /article/media/ permanent;

www.5i1show.com/article/view/p1/跳轉到www.5i1show.com/article/media/


暫時先寫一部分,看看有沒有需要的,如果你也有更好的可以一起探討,


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