Loading
0

sablog程序Nginx下伪静态规则

技术小学生微信公众号
腾讯云服务器大促销。
华为服务器
sablog程序Nginx下伪静态规则,安全天使,请将如下规则添加到对应站点配置文件.conf文件中,添加后需重启nginx服务配置才会生效,若不会添加或添加有问题,可留言告知我们协助处理

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/([0-9]+)?/?$ /rss.php?cid=$1 last;
    rewrite ^/rss/([^/]+)/?$ /rss.php?url=$1 last;
    rewrite ^/uid/([0-9]+)/?([0-9]+)?/?$ /index.php?action=article&uid=$1&page=$2 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;
}

技术小学生微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://blog.tag.gg/showinfo-7-35982-0.html
亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
上一篇:海洋CMS/seacms程序Nginx下伪静态规则
下一篇:phpwind论坛Nginx下伪静态规则