emlog在nginx上的伪静态规则


在conf下面新建文件emlog.conf

vim emlog.cnf

location /

{

rewrite ^([^.]*)/post-(.+).html$ $1/index.php?post=$2 last;
        rewrite ^([^.]*)/record/(.+)/page/(.+)$ $1/index.php?record=$2&page=$3 last;
        rewrite ^([^.]*)/record/(.+)$ $1/index.php?record=$2 last;
        rewrite ^([^.]*)/sort/(.+)/page/(.+)$ $1/index.php?sort=$2&page=$3 last;
        rewrite ^([^.]*)/sort/(.+)$ $1/index.php?sort=$2 last;
        rewrite ^([^.]*)/author/(.+)/page/(.+)$ $1/index.php?author=$2&page=$3 last;
        rewrite ^([^.]*)/author/(.+)$ $1/index.php?author=$2 last;
        rewrite ^([^.]*)/tag/(.+)/page/(.+)$ $1/index.php?tag=$2&page=$3 last;
        rewrite ^([^.]*)/tag/(.+)$ $1/index.php?tag=$2 last;
        rewrite ^([^.]*)/page/(.+)$ $1/index.php?page=$2 last;
        rewrite ^([^.]*)/page/(.+)$ $1/index.php?page=$2 last;
        rewrite ^([^.]*)/post-(.+).html#(.+)$ $1/index.php?post=$2#$3 last;

}

 

在配置文件里面使用这个文件就行了。


Whatever is worth doing is worth doing well.