宝塔面板伪静态规则

2026-10-05 分类:Lite 作者:zhangwei 浏览 33

为了方便使用宝塔面板的用户快速部署,可以使用此伪静态规则:

# ==========================================================
# LiteLog 伪静态规则(一次性配置,装任何插件都不用改)
# ==========================================================

# 静态资源直接返回
if (-f $request_filename) { break; }
if (-d $request_filename) { break; }

# ---------- LiteLog 核心路由 ----------
rewrite ^/post/(\d+)\.html$ /index.php?post=$1 last;
rewrite ^/post/([^/]+)\.html$ /index.php?alias=$1 last;
rewrite ^/sort/([^/]+)/?$ /index.php?sort_alias=$1 last;
rewrite ^/tag/([^/]+)/?$ /index.php?tag=$1 last;
rewrite ^/author/(\d+)/?$ /index.php?author=$1 last;
rewrite "^/record/(\d{4}-\d{2})/?$" /index.php?record=$1 last;

# ---------- 通用插件路由(自动适配所有插件) ----------
rewrite ^/([a-zA-Z][a-zA-Z0-9_-]*)/?$ /index.php?__plugin_path=$1 last;
rewrite ^/([a-zA-Z][a-zA-Z0-9_-]*)/(.+)$ /index.php?__plugin_path=$1&__plugin_rest=$2 last;

评论 (0)

还没有评论,来说点什么吧~

发表评论

正在回复
已有账号?登录后评论