最新公告
  • 欢迎您光临仿站吧 帝国CMS模板一站式建站供应平台 . 欢迎加入VIP
  • CSCMS程式CMS Nginx伪静态分享

    正文概述 仿站吧   2023-06-17 05:46:22  
    CSCMS程式CMS Nginx伪静态规则分享

    location / {
    rewrite "^([^.]*)/([a-zA-Z0-9\_-]+)/home(.*)$" /index.php/$1/home$2 last;
    rewrite "^([^.]*)/gbook$" /index.php/gbook last;
    rewrite "^([^.]*)/page(.*)$" /index.php/page$1 last;
    rewrite "^([^.]*)/opt(.*)$" /index.php/opt$1 last;
    rewrite "^([^.]*)/user(.*)$" /index.php/user$1 last;
    rewrite "^([^.]*)/api/(.*)$" /index.php/api/$1 last;
    #图片重定向
    rewrite "^([^.]*)/picdata(.*)$" /index.php/picdata$1 last;
    # 视频伪静态
    rewrite "^([^.]*)/vod(.*)$" /index.php/vod$1 last;
    # 歌曲伪静态
    rewrite "^([^.]*)/dance(.*)$" /index.php/dance$1 last;
    # 歌手伪静态
    rewrite "^([^.]*)/singer(.*)$" /index.php/singer$1 last;
    # 视频伪静态
    rewrite "^([^.]*)/vod(.*)$" /index.php/vod$1 last;
    # 文章伪静态
    rewrite "^([^.]*)/news(.*)$" /index.php/news$1 last;
    # 专集伪静态
    rewrite "^([^.]*)/topic/(.*)$" /index.php/zj/$1 last;
    rewrite "^([^.]*)/zj/(.*)$" /index.php/zj/$1 last;
    break;
    }


    开发兔kaifatu.com提醒您  如果遇到后台404可以试试如下Nginx伪静态规则

    if (!-f $request_filename){
    set $rule_0 1$rule_0;
    }
    if (!-d $request_filename){
    set $rule_0 2$rule_0;
    }
    if ($rule_0 = "21"){
    rewrite ^/(.*)$ /index.php?/$1 last;
    }
    仿站吧,一个优质的源码资源平台!
    仿站吧 » CSCMS程式CMS Nginx伪静态分享