我们家新建了一个站,在做404测试的时候,遇到404不跳到我们自己定义的404页面,怎么样才能解决啊?
我们看后台代码,有下面一个函数,求解函数的具体作用
Public Sub GotoErrPage()
Dim PageUrl,IsLogin,IsErrPage
PageUrl = Request.ServerVariables("Script_Name")
IsLogin = InStr(PageUrl , "Master/")
IsErrPage = InStr(PageUrl , "ErrPage.asp")

If SiteClose = "1" And IsLogin = "0" And IsErrPage = "0" Then
Response.Redirect(PagePath & "ErrPage.asp")
Response.End()
End If
End Sub

解决方案 »

  1.   

    web.config 不能配置吗??????
      

  2.   

    配置文件中配置
        <customErrors mode="Off"  defaultRedirect="http://news..cn/page/p404.aspx">
          <error statusCode="500" redirect="http://news..cn/page/pdown.aspx" />
          <error statusCode="404" redirect="http://news..cn/page/p404.aspx" />
        </customErrors>
      

  3.   

    你的是异常抛出显示404,还是打开网址的时间显示呢,
    前者应该可能从WebConifg设置,后者是你的IIS
    架构的问题。
    <customErrors mode="Off" defaultRedirect="~/ErrorPage.aspx">
          <error statusCode="403" redirect="~/ErrorPage.aspx"/>
          <error statusCode="404" redirect="~/ErrorPage.aspx"/>
        </customErrors>
      

  4.   

    在iis 上有一个 自定义错误的 选项卡  找到404错误文件, 设置成你的 页面就可以了
      

  5.   

    在webconfig里面配置:
    <customErrors mode="On" defaultRedirect="Error.aspx">
          <error statusCode="403" redirect="Error.aspx" />
          <error statusCode="404" redirect="Error.aspx" />
        </customErrors>
      

  6.   

    在webconfig里面配置:
    <customErrors mode="On" defaultRedirect="Error.aspx">
      <error statusCode="403" redirect="403.aspx" />
      <error statusCode="404" redirect="404.aspx" />
      </customErrors>发布后别的机器访问才看的到效果,本机访问的话,只是一个错误提示
      

  7.   

    是想让,网站出错的时候,跳到自己的这个404页面,我看了一下ftp上,没有webconfig文件啊
      

  8.   

    这个问题我们强大地csdn最有发言权了,404你懂得怎么会没有webconfig?你做的是asp.net网站?
      

  9.   

    CSDN  404 你懂得 哈哈
      

  10.   

    Web.config配置
    <customErrors mode="Off" defaultRedirect="GenericErrorPage.aspx">
          <error statusCode="403" redirect="NoAccess.aspx" />
          <error statusCode="404" redirect="FileNotFound.aspx" />
        </customErrors>
      

  11.   

    Web.config配置
    <customErrors mode="Off" defaultRedirect="GenericErrorPage.aspx">
      <error statusCode="403" redirect="NoAccess.aspx" />
      <error statusCode="404" redirect="FileNotFound.aspx" />
      </customErrors>
      

  12.   

    回复又被csdn吃了,真是懂你妹呢不可能没有webconfig文件,网站不是你自己做的?