无法访问我服务器中的网站

can't access to website in my server

我在一个平台的 localhost 工作。 流程是:

  1. LOGIN.ASP 输入我的登录信息(用户名+密码)

在 login.asp 我有这个

If Session("isAdmin") Then
    Response.Redirect "../default.asp"
Else
    Response.Redirect "../index.asp"
End If

虽然在服务器中给我错误

An error occurred on the server when processing the URL.
Please contact the system administrator. If you are the system administrator please click here to find out more about this error.

url 是 /common/_loginme。asp 在此页面中,代码是:

<%    
Dim username, password
username = Request.Form("username")
password = Request.Form("password")
If username = "" Then Response.Redirect "login.asp?m=Username é obrigatório."
If password = "" Then Response.Redirect "login.asp?m=Password é obrigatório."
%>
<!-- #include file="_db.asp" -->
<%
sqlLogin = "SELECT TOP 1 id, roleId, name FROM Users WHERE isActive = True AND username = '" & CleanStr(username) & "' AND password = '" & CleanStr(password) & "'"
Set RSlogin = Conn.Execute(sqlLogin)
If RSlogin.EOF Then
    Rslogin.Close
    Closeconn
    Response.Redirect "../login.asp?m=Username ou Password incorretas."
Else
    Session("isAdmin") = RSlogin("roleId") = 1
    Session("LoginID") = RSlogin("id")
    Session("Name") = RSlogin("name")
    Rslogin.Close
    Closeconn
    If Session("isAdmin") Then
        Response.Redirect "../default.asp"
    Else
        Response.Redirect "../index.asp"
    End If
End If
RSlogin.Close
Closeconn
%>
<%
Function CleanStr(s)    
    s = Replace(s,"'","")
    s = Replace(s,"<","")
    s = Replace(s,">","")
    s = Replace(s,";","")
    CleanStr = s
End Function
%>

为什么我在本地主机上 运行 很好,但服务器却不行?

还有一个片段,web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <remove value="Default.asp" />
                <add value="Login.asp" />
            </files>
        </defaultDocument>

    </system.webServer>
</configuration>

您描述的错误是标准 ASP 错误消息,因此用户无法在生产服务器上获得有关错误的信息。

虽然这是期望的行为,但您必须启用错误输出,这样您才能看到出了什么问题。

在服务器的 IIS 设置中,选择 ASP,打开 "Debugging Properties" 并启用选项 "Send Errors To Browser"。

更多详细信息here or here

通过这种方式,您应该获得有关生产设置中真正失败的更多信息。