您现在的位置: 动易技术中心 >> 动易产品知识库 >> SiteWeaver常见问题 >> 正文
打开网站首页时怎么让地址栏上不显示出网页的扩展名

   默认情况下,动易的标签 {$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


将其修改为

                    If rsChannel("UseCreateHTML") > 0 Then
                        strChannel = strChannel & " href='" & ChannelUrl  & "/'"
                    Else
                        strChannel = strChannel & " href='" & ChannelUrl & "/'"
                    End If


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

 

 

 

                 ------感谢 阵风网络 提供------

文章录入:luotoal    责任编辑:luotoal 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    动易SiteFactory标签说明
    动易2006网站标签说明列表
    动易用户手册
    联系我们 | 关于动易 | 网站地图 | 相关证书 | 合作伙伴 | 招贤纳士 | 法律条款 | 隐私权声明
    安全上网网上报警
    动易网络科技有限公司版权所有 © 2003-  粤ICP备05004015号
    公安备案编号:4406063010734 本站基于 PowerEasy® SiteWeaver™ 制作