zoukankan      html  css  js  c++  java
  • wuzhi 五指 伪静态

    rewrite ^(.*)list/([0-9]+)-([0-9]+).html$ $1index.php?v=listing&cid=$2&page=$3 last;

    rewrite ^(.*)show/([0-9]+)-([0-9]+).html$ $1index.php?v=show&cid=$2&id=$3 last;

    //动态改成伪静态-list
     function tolist($path_info='http://192.168.0.11/index.php?v=listing&cid=14&page=1')
    {
        $match = "/^(.*)index.php?v=listing&cid=([0-9]+)&page=([0-9]+)/";
        //$path_info = 'http://192.168.0.11/index.php?v=listing&cid=14&page=1';
    
        if(preg_match($match,$path_info,$arr_path)){
            
            return "$arr_path[1]list/$arr_path[2]-$arr_path[3].html";
    
        }else{
            return $path_info;
        }
    }
    //动态改成伪静态-show
     function toshow($path_info='http://192.168.0.11/index.php?v=show&cid=10&id=36')
    {
        $match = "/^(.*)index.php?v=show&cid=([0-9]+)&id=([0-9]+)/";
        //$path_info = 'http://192.168.0.11/index.php?v=listing&cid=14&page=1';
    
        if(preg_match($match,$path_info,$arr_path)){
            
            return "$arr_path[1]show/$arr_path[2]-$arr_path[3].html";
    
        }else{
            return $path_info;
        }
    }
  • 相关阅读:
    HDU What Are You Talking About
    谷歌面试题
    POJ 2299 UltraQuickSort
    单链表排序
    HDU Hat’s Words
    C++ const关键字
    求二叉树任意两点间的距离
    HDU Phone List
    POJ 2352 Stars
    C++ volatile关键字
  • 原文地址:https://www.cnblogs.com/aliblogs/p/5736347.html
Copyright © 2011-2022 走看看