nginx配置网站的二级目录项目伪静态

帝国下嵌套wordpress

因为业务需求,需要在网站的二级目录下建立一个新项目dbin,新项目也要用url重写的方式访问,比如www.xxx.com/dbin/…….。

试着配置了一下nginx的重写规则,如下:


location / {
            if (!-e $request_filename) { 
            rewrite ^([^\.]*)/listinfo-(.+?)-(.+?)\.html$ $1/e/action/ListInfo/index.php?classid=$2&page=$3 last;
          rewrite ^([^\.]*)/showinfo-(.+?)-(.+?)-(.+?)\.html$ $1/e/action/ShowInfo.php?classid=$2&id=$3&page=$4 last;
          rewrite ^([^\.]*)/infotype-(.+?)-(.+?)\.html$ $1/e/action/InfoType/index.php?ttid=$2&page=$3 last;
          rewrite ^([^\.]*)/tags/(.+?)-(.+?)\.html$ $1/e/tags/index.php?tagname=$2&page=$3 last;
           return 404;
           }
        }
location /steelfurniture/ {
            index  index.html index.htm index.php l.php;
            autoindex  off;
            
            if (!-e $request_filename){
                rewrite  ^/steelfurniture/(.*)$  /steelfurniture/index.php/$1  last;
            }
        }
暂无评论

发送评论 编辑评论


				
上一篇
下一篇