views:

28

answers:

1

Is this custom 404 page supposed to work? It was created by another developer... Running 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://domain.ca/_bin/images/logo.jpg"/&gt;
<H1><%=Replace(strQString,"404;","")%> -  cannot be found.</H1>
<H2> Attempting to redirect to <a href="<%=strURL%>"><%=strURL%></a> ...</H2>
</BODY>
</HTML>
A: 

These kind of things are not recommended if you care about SEO. Either fix the problem for 500 errors or put a 301 PERMANENT REDIRECT for 404 errors but dynamic redirects are not going to be seen favorably by robots..

RandyMorris
Thanks for your comment. We are not worried about robots as the subfolders are only for existing links to web apps we host for our employees.
Kolten