Jan 11

去掉顶部频道显示处的网站首页及频道地址的扩展名 雪

阵风 , 22:24 , 动易 , 评论(4) , 引用(0) , 阅读(1008) , Via 本站原创 | |
大部分情况下,http://www.zhangzhenfeng.com/ 与 http://www.zhangzhenfeng.com/index.asp 的 Google PageRank 是不同的。据说,在google 看来,目录的权重比文件大。默认情况下,动易的标签 {$ShowChannel} 输出时,网站首页、频道首页的地址都是{$InstallDir}index.htm、{$InstallDir}Article/index.asp 的形式,如何才能修改为 {$InstallDir}、{$InstallDir}Article/ 的形式呢?

只需修改 Include/PowerEasy.Common.Front.asp 中的Function GetChannelList(NumNewLine),进而改变标签 {$ShowChannel} 的输出即可。下面以动易开源版SiteWeaver™ CMS 6.5为例进行说明。

第一步,将网站首页地址由 {$InstallDir}index.htm 的形式修改为 {$InstallDir} 的形式。在 Include/PowerEasy.Common.Front.asp 中找到如下代码:
引用
        If ChannelID = 0 Then
            strChannel = ChannelLink & "<a class='Channel2' href='" & strInstallDir & FileName_SiteIndex & "'>" & XmlText("BaseText", "FirstPage", "网站首页") & "</a>" & ChannelLink
        Else
            strChannel = ChannelLink & "<a class='Channel' href='" & strInstallDir & FileName_SiteIndex & "'>" & XmlText("BaseText", "FirstPage", "网站首页") & "</a>" & ChannelLink
        End If


将其修改为
引用
        If ChannelID = 0 Then
            strChannel = ChannelLink & "<a class='Channel2' href='" & strInstallDir  & "'>" & XmlText("BaseText", "FirstPage", "网站首页") & "</a>" & ChannelLink
        Else
            strChannel = ChannelLink & "<a class='Channel' href='" & strInstallDir & "'>" & XmlText("BaseText", "FirstPage", "网站首页") & "</a>" & ChannelLink
        End If


第二步,将频道首页地址由 {$InstallDir}Article/index.htm 的形式修改为 {$InstallDir}Article/ 的形式。在 Include/PowerEasy.Common.Front.asp 中找到如下代码:
引用
                    If rsChannel("UseCreateHTML") > 0 Then
                        strChannel = strChannel & " href='" & ChannelUrl & "/Index" & arrFileExt(rsChannel("FileExt_Index")) & "'"
                    Else
                        strChannel = strChannel & " href='" & ChannelUrl & "/Index.asp'"
                    End If


将其修改为
引用
strChannel = strChannel & " href='" & ChannelUrl & "/'"


修改完成后,保存文件,更新缓存,如果网站首页或某频道首页需要生成html,进行生成后刷新页面即可。另外,注意一下默认文档顺序(例如:网站首页生成html后缀为“.htm”,但默认文档中index.asp i优先于 index.htm,则访问网站目录 {$InstallDir} 时,系统会调用index.asp而非index.htm,然后跳转到index.htm,这种情况下地址栏显示的地址不是目录形式,多了个index.htm)
yimome
2008/08/24 19:09
嗯,查找到了,谢谢你的帮助啦,cool

一个远方默默支持的网友。
yimome
2008/08/21 12:37
能不能给二级栏目也进行这种修改呢?
阵风 回复于 2008/08/21 21:00
当然可以。不过栏目显示时默认为js调用,修改起来麻烦一点——动易论坛有相关帖子,我也回复的有,你去看看。另外,如果使用自定义标签调用,就可以自己酌情增减——论坛也有调用栏目的标签。
PEfans
2008/01/13 16:25
这个非常实用!
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]