Discuz教程网

Discuz X2.5 SEO设置里URL 静态化(伪静态)名字修改方法

[复制链接]
authicon dly 发表于 2012-9-29 18:59:34 | 显示全部楼层 |阅读模式
伪静态来源于静态页,而静态页地址是永远不变的,是唯一的。对于搜索引擎来说很友好,所以为了提高网站的收录排名,就尽量让网页以静态页的方式显示。大部分程序是可以全站生成静态页的。不能生成的可以伪静态,对于搜索引擎来说静态与伪静态是一样效果的。

伪静态与静态最大的不同是,静态页是不用服务器运行代码的,也就是说静态页能节约服务器处理资源,能提供更多的在线人数。

Discuz认识到了伪静态的重要性,也有相应功能设置。默认的伪静态URL显示效果如下:
门户专题页 {name}   topic-{name}.html
门户文章页 {id}, {page}   article-{id}-{page}.html
论坛主题列表页 {fid}, {page}   forum-{fid}-{page}.html
论坛主题内容页 {tid}, {page}, {prevpage}   thread-{tid}-{page}-{prevpage}.html
群组主题列表页 {fid}, {page}   group-{fid}-{page}.html
用户个人主页 {user}, {value}   space-{user}-{value}.html
用户日志内容页 {uid}, {blogid}   blog-{uid}-{blogid}.html
论坛 Archiver 页 {action}, {value}   {action}-{value}.html
插件 {pluginid}, {module}  {pluginid}-{module}.html

以上可以在DZ后台-全局-SEO设置-URL 静态化 设置。如图:
360截图20120929185841734.png

现在来说明怎么修改名字,以上蓝色字体的粗体部分是可以自由修改的,这样就实现了在网页上显示你自己设置的URL。注意有{}部分是一定修改的。

好了这个修改后,只是在网页上显示。当你点击后是不能正常打开的,这是因为伪静态规则还没修改过来。

以以下规则为例,绿色粗体部分的修改要与上面对应。

IIS Web Server(独立主机用户)
[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteRule ^(.*)/topic-(.+)\.html(\?(.*))*$ $1/portal\.php\?mod=topic&topic=$2&$4
RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/portal\.php\?mod=view&aid=$2&page=$3&$5
RewriteRule ^(.*)/forum-(\w+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=forumdisplay&fid=$2&page=$3&$5
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=viewthread&tid=$2&extra=page\%3D$4&page=$3&$6
RewriteRule ^(.*)/group-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/forum\.php\?mod=group&fid=$2&page=$3&$5
RewriteRule ^(.*)/blog-([0-9]+)-([0-9]+)\.html(\?(.*))*$ $1/home\.php\?mod=space&uid=$2&do=blog&id=$3&$5
RewriteRule ^(.*)/(fid|tid)-([0-9]+)\.html(\?(.*))*$ $1/index\.php\?action=$2&value=$3&$5





上一篇:Discuz X2.5 设置用户组发外链权限
下一篇:Discuz X2.5 查看论坛目录权限设置是否正确
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-5-20 10:12

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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