DiscuzX3.0X3.1X3.2通用伪静态设置和伪静态规则.doc
文本预览下载声明
Discuz! X3.0/X3.1/X3.2通用 伪静态设置和伪静态规则
首先简单讲一下为什么要做伪静态,伪静态是相对真实静态来讲的,通常我们为了增强搜索引擎的友好面,都将文章内容生成静态 页面,但是有的朋友为了实时的显示一些信息。或者还想运用动态脚本解决一些问题。不能用静态的方式来展示网站内容。但是这就损失了对搜索引擎的友好面。怎 么样在两者之间找个中间方法呢,这就产生了伪静态技术。就是展示出来的是以html一类的静态页面形式,这种html的显示形式更加有利于SEO。现在开源程序越来越流行了,很多新手站长在用Discuz程序搭建网站后,会发现自己的网站地址是动态地址,所谓动态地址就是带有?号这种,比如/forum.php?mod=···这种就属于动态地址,那么,我们想要网站就行伪静态,也就是以html结尾的网址,该如何做呢?1.在后台“全局》SEO设置》URL 静态化”相关复选框全部勾选,点“提交”按钮。如下图2.根据web服务器选择相应的伪静态规则:Apache Web Server(独立主机用户)
Apache Web Server(虚拟主机用户)
IIS Web Server(独立主机用户)
IIS7 Web Server(独立主机用户)
Zeus Web Server
match URL into $ with ^(.*)/topic-(.+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/portal.php?mod=topictopic=$2$3endifmatch URL into $ with ^(.*)/article-([0-9]+)-([0-9]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/portal.php?mod=viewaid=$2page=$3$4endifmatch URL into $ with ^(.*)/forum-(\w+)-([0-9]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/forum.php?mod=forumdisplayfid=$2page=$3$4endifmatch URL into $ with ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/forum.php?mod=viewthreadtid=$2extra=page\%3D$4page=$3$5endifmatch URL into $ with ^(.*)/group-([0-9]+)-([0-9]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/forum.php?mod=groupfid=$2page=$3$4endifmatch URL into $ with ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/home.php?mod=space$2=$3$4endifmatch URL into $ with ^(.*)/blog-([0-9]+)-([0-9]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/home.php?mod=spaceuid=$2do=blogid=$3$4endifmatch URL into $ with ^(.*)/(fid|tid)-([0-9]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/index.php?action=$2value=$3$4endifmatch URL into $ with ^(.*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html\?*(.*)$if matched then? ?? ???set URL = $1/plugin.php?id=$2:$3$4endif
Nginx Web Server
rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topictopic=$2 last;rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html
显示全部