Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is my 404.asp error handling page correct

Status
Not open for further replies.

leeboycymru

Programmer
Jan 23, 2007
185
GB
I have put together a 404.asp error handling page that I havent sorted out yet with my clients host.

I re-designed a clients webapge, and moved some of his .htm files to .asp so i was told that this is the best way of handling it.

I have entered the code below, and was wondering if somebody could check it out before I go any further.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Redirect</title>
</head>

<body>
<%
strRedirect = Mid(lcase(Request.QueryString), 5)
%>

<%
Select Case strRedirect
Case " Response.Redirect(" Case Else
Response.Redirect(" End Select
%>
</body>
</html>

I put a case else statement at the end, that redirects the user to my home page if they come across this page accidently I think, is this right also.

cheers

Lee
 
see thread828-1321205

and




response.redirect on IIS will give a 302 response NOT a 301 which is what you need.


Actually the best way to handle it is to change the Application Mappings to have .htm(l) parsed for asp code.
No redirect needed, no problems with loss of SE traffic.



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Thanks for that,

the new .asp files in all the cases are not the identical url path of the .htm files as I have condensed many of the pages into one asp page that handles the information through if statments, so will the links above show me how to handle those redirect pages.

lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top