Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[教程] lighttpd下discuzx2伪静态规则

[复制链接]
xiaoyuwxz 发表于 2011-7-19 06:20:43 | 显示全部楼层 |阅读模式
本帖最后由 xiaoyuwxz 于 2016-3-2 20:38 编辑

规则文件为:


加载方法有两种:

一、直接加载到配置文件中
修改配置lighttpd配置文件如:lighttpd.conf或者lighttpd-vhost.conf
在server.document-root = "/home/wwwroot/htdocs"下面一行添加以上规则,保存退出后重启lighttpd服务即可

二、创建规则文件后添加到配置文件
在/etc/lighttpd目录创建规则文件discuzx2.conf内容为以上的规则内容,退出保存
修改配置lighttpd配置文件如:lighttpd.conf或者lighttpd-vhost.conf
在server.document-root = "/home/wwwroot/htdocs"下面一行添加一行:
include "discuzx2.conf"
退出保存重启lighttpd服务

dzx3.2规则为
url.rewrite-once = (
"^(.*)/topic-(.+)\.html$" => "$1/portal.php?mod=topic&topic=$2"
"^(.*)/article-([0-9]+)-([0-9]+)\.html$" => "$1/portal.php?mod=view&aid=$2&page=$3"
"^(.*)/forum-(\w+)-([0-9]+)\.html$" => "$1/forum.php?mod=forumdisplay&fid=$2&page=$3"
"^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "$1/forum.php?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3"
"^(.*)/group-([0-9]+)-([0-9]+)\.html$" => "$1/forum.php?mod=group&fid=$2&page=$3"
"^(.*)/space-(username|uid)-(.+)\.html$" => "$1/home.php?mod=space&$2=$3"
"^(.*)/blog-([0-9]+)-([0-9]+)\.html$" => "$1/home.php?mod=space&uid=$2&do=blog&id=$3"
"^(.*)/(fid|tid)-([0-9]+)\.html$" => "$1/index.php?action=$2&value=$3"
"^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$" => "$1/plugin.php?id=$23"
)
newsfriend 发表于 2011-7-19 06:21:50 | 显示全部楼层
支持下 小雨
回复

使用道具 举报

goddesschi 发表于 2011-7-31 23:03:19 | 显示全部楼层
新手請教,加上後有什麼好處?
不太了解伪静态规则的用意
回复

使用道具 举报

graphics 发表于 2011-8-1 11:09:54 | 显示全部楼层
这个很好用
回复

使用道具 举报

liwenxi 发表于 2011-8-30 03:35:43 | 显示全部楼层
好东西 留记号
回复

使用道具 举报

Noyskk 发表于 2011-8-30 11:00:05 | 显示全部楼层
嗯。很好用。那nginx能不能通过include语句来配置伪静态呢?
回复

使用道具 举报

 楼主| xiaoyuwxz 发表于 2011-8-30 11:51:58 | 显示全部楼层
Noyskk 发表于 2011-8-30 11:00
嗯。很好用。那nginx能不能通过include语句来配置伪静态呢?

nginx这样写:

include discuzx.conf;

不用引号,就这点区别
回复

使用道具 举报

Noyskk 发表于 2011-8-30 12:52:41 | 显示全部楼层
嗯。又长知识了
回复

使用道具 举报

298610601 发表于 2011-9-26 22:09:03 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

wlm824 发表于 2011-9-27 16:34:17 | 显示全部楼层
留个记号
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-17 16:23 , Processed in 0.143600 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表