动易SiteWeaver系统去除首页和频道扩展名的方法
作者:giffer 日期:2009-04-24
动易是一款非常优秀的CMS系统,420studio使用的就是动易的早期版本,为了紧跟动易不断发展的新版本脚步,于是开始对420studio进行升级到动易的最新版本SiteWeaver6.7 ,但是在使用SiteWeaver6.7的时候考虑到搜索引擎优化于是需要去除动易系统自带的扩展名。具体情况如下:
几乎所有的动易版本都存在这样的情况:
首页:www.giffer.cn/index.html
频道:www.giffer.cn/news/index.html
而对手搜索引擎优化人员肯定希望实现的方式是:
首页:www.giffer.cn/
频道:www.giffer.cn/news/
即去掉首页和频道页面的扩展名,具体操作如下:
第一步,将网站首页地址由 {$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
将其修改为:
程序代码
第二步,将频道首页地址由 {$InstallDir}Article/index.htm 的形式修改为 {$InstallDir}Article/ 的形式。在 Include/PowerEasy.Common.Front.asp 中找到如下代码:
程序代码
将其修改为
程序代码
修改完成后,保存文件,更新缓存,如果网站首页或某频道首页需要生成html,进行生成后刷新页面即可。另外,注意一下默认文档顺序(例如:网站首页生成html后缀为“.htm”,但默认文档中index.asp i优先于 index.htm,则访问网站目录 {$InstallDir} 时,系统会调用index.asp而非index.htm,然后跳转到index.htm,这种情况下地址栏显示的地址不是目录形式,多了个index.htm。也就是说index.html要优先于index.asp)
几乎所有的动易版本都存在这样的情况:
首页:www.giffer.cn/index.html
频道:www.giffer.cn/news/index.html
而对手搜索引擎优化人员肯定希望实现的方式是:
首页:www.giffer.cn/
频道:www.giffer.cn/news/
即去掉首页和频道页面的扩展名,具体操作如下:
第一步,将网站首页地址由 {$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
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 & "/Index" & arrFileExt(rsChannel("FileExt_Index")) & "'"
Else
strChannel = strChannel & " href='" & ChannelUrl & "/Index.asp'"
End If
将其修改为
程序代码 If rsChannel("UseCreateHTML") > 0 Then
strChannel = strChannel & " href='" & ChannelUrl & "/'"
Else
strChannel = strChannel & " href='" & ChannelUrl & "/'"
End If
strChannel = strChannel & " href='" & ChannelUrl & "/'"
Else
strChannel = strChannel & " href='" & ChannelUrl & "/'"
End If
修改完成后,保存文件,更新缓存,如果网站首页或某频道首页需要生成html,进行生成后刷新页面即可。另外,注意一下默认文档顺序(例如:网站首页生成html后缀为“.htm”,但默认文档中index.asp i优先于 index.htm,则访问网站目录 {$InstallDir} 时,系统会调用index.asp而非index.htm,然后跳转到index.htm,这种情况下地址栏显示的地址不是目录形式,多了个index.htm。也就是说index.html要优先于index.asp)
评论: 0 | 引用: 0 | 查看次数: 2244
发表评论
上一篇
下一篇


文章来自:
Tags: 




