Asp classic 定制404-这能用吗?

Asp classic 定制404-这能用吗?,asp-classic,http-status-code-404,Asp Classic,Http Status Code 404,这个自定义404页面应该工作吗?它是由另一个开发人员创建的。。。 运行IIS7 <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% strQString=lcase(Request.ServerVariables("QUERY_STRING")) If (Len(strQString)>4) Then strURL=Right(strQString,Len(strQString)-4) If (instr(lcas

这个自定义404页面应该工作吗?它是由另一个开发人员创建的。。。 运行IIS7

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<%
 strQString=lcase(Request.ServerVariables("QUERY_STRING"))
 If (Len(strQString)>4) Then
  strURL=Right(strQString,Len(strQString)-4)
  If (instr(lcase(strQString),"www")>1) then
   strURL = Replace(lcase(strURL),"www","www2")
  Else
   strURL = Replace(lcase(strURL),"http://","http://www2.")
  End If
 End If
%>

<HTML>
<HEAD>
<META HTTP-EQUIV="refresh" CONTENT="3;URL=<%=strURL%>">
<style>
BODY{
 color: black;
 font-family: Arial;
 text-align: center;
 }
H1{font-size: 16px;}
H2{font-size: 12px;}
</style>
</HEAD>
<BODY>
<img src="http://example.ca/_bin/images/logo.jpg"/>
<H1><%=Replace(strQString,"404;","")%> -  cannot be found.</H1>
<H2> Attempting to redirect to <a href="<%=strURL%>"><%=strURL%></a> ...</H2>
</BODY>
</HTML>

如果你关心搜索引擎优化,就不推荐使用这些东西。
修复500个错误的问题,或者为404个错误设置301永久重定向,但是机器人不会喜欢动态重定向。

谢谢您的评论。我们不担心机器人,因为子文件夹仅用于现有链接,这些链接指向我们为员工托管的web应用程序。