差别
这里会显示出您选择的修订版和当前版本之间的差别。
— |
amh4.2:nginx_rewrite_rule:sablog [2017/05/26 16:04] (当前版本) root 创建 |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | =====sablog在nginx下的伪静态规则===== | ||
+ | \\ | ||
+ | \\ | ||
+ | <code> | ||
+ | location / { | ||
+ | rewrite ^/date/([0-9]{6})/?([0-9]+)?/?$ /index.php?action=article&setdate=$1&page=$2 last; | ||
+ | rewrite ^/page/([0-9]+)?/?$ /index.php?action=article&page=$1 last; | ||
+ | rewrite ^/category/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&cid=$1&page=$2 last; | ||
+ | rewrite ^/category/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&curl=$1&page=$2 last; | ||
+ | rewrite ^/(archives|search|article|links)/?$ /index.php?action=$1 last; | ||
+ | rewrite ^/(comments|tagslist|trackbacks|article)/?([0-9]+)?/?$ /index.php?action=$1&page=$2 last; | ||
+ | rewrite ^/tag/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&item=$1&page=$2 last; | ||
+ | rewrite ^/archives/([0-9]+)/?([0-9]+)?/?$ /index.php?action=show&id=$1&page=$2 last; | ||
+ | rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last; | ||
+ | rewrite ^/user/([^/]+)/?([0-9]+)?/?$ /index.php?action=article&user=$1&page=$2 last; | ||
+ | rewrite sitemap.xml sitemap.php last; | ||
+ | rewrite ^(.*)/([0-9a-zA-Z\-\_]+)/?([0-9]+)?/?$ $1/index.php?action=show&alias=$2&page=$3 last; | ||
+ | } | ||
+ | </code> |
最后更改: in 2017/05/26 16:04