2010-06-15 32 views
0

這個自定義404頁面應該工作嗎?它是由另一個開發者創建... 運行IIS7自定義404 - 這項工作?

<%@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> 

回答

0

如果你關心SEO不建議這類事情。 要麼解決500個錯誤的問題,要麼爲301錯誤設置301 PERMANENT REDIRECT,但動態重定向不會被機器人看好。

+0

感謝您的評論。我們並不擔心機器人,因爲子文件夾僅適用於我們爲員工託管的Web應用程序的現有鏈接。 – Kolten 2010-06-15 16:54:39