zoukankan      html  css  js  c++  java
  • nginx配置phpcms v9伪静态规则 phpcms伪静态 404 Not Found

    location / { 
    if (!-f $request_filename){ 
    rewrite (.*) /index.php; 
    } 
    rewrite ^/caipu-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last; 
    rewrite ^/content-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=show&catid=$1&id=$2&page=$3 last; 
    rewrite ^/list-([0-9]+)-([0-9]+).html /index.php?m=content&c=index&a=lists&catid=$1&page=$2 last; 
    rewrite ^/tag-([^.]*)-([0-9]+)-([0-9]+).html /index.php?m=content&c=tag&catid=$2&tag=$1&page=$3 last; 
    rewrite ^/comment-([0-9]+)-([0-9]+)-([0-9]+).html /index.php?m=comment&c=index&a=init&commentid=content_$1-$2-$3 last; 
    rewrite ^/([^.]*).html /index.php?m=member&c=index&a=$1 last; 
    }
    

     以上规则有一些问题 ,请测试使用

    下面是我自己写的:

    可以正常使用

    location / {
    ###以下为PHPCMS 伪静态化rewrite法则
    rewrite ^/(.*)content-([0-9]+)-([0-9]+)-([0-9]+).html  /index.php?m=content&c=index&a=show&catid=$2&id=$3&page=$4;
    rewrite ^/(.*)show-([0-9]+)-([0-9]+)-([0-9]+).html  /index.php?m=content&c=index&a=show&catid=$2&id=$3&page=$4;
    rewrite ^/(.*)list-([0-9]+)-([0-9]+).html  /index.php?m=content&c=index&a=lists&catid=$2&page=$3;
    
    
    }
    

      

     

     

  • 相关阅读:
    根据数据库表字段动态生成选择画面
    ABAP中字符串处理方法小结(二)
    如何获取汉字字符串长度
    如何强制分页-[NEW-PAGE]
    如何设置输出颜色-[FORMAT..COLOR..]
    ◆◆0如何取得字符串最后一位
    VALSE2019
    pycharm使用总结
    生活经验
    爱情存在吗-3
  • 原文地址:https://www.cnblogs.com/yuesha/p/11284221.html
Copyright © 2011-2022 走看看