Jump to content

404 Error Code


Guest angkorboy
 Share

Recommended Posts

404 Trick for Web Promotion.search engine's point of view. It is the biggest benefit to have well named pages. Most search engines, like Alta Vista and Yahoo.For example: Main Category: www.cambodia-tourism.org/index.asp?cat=26 is not memorable as Main Category: www.cambodia-tourism.org/Hospitality_CateringSub Category: wwww.cambodia-tourism.org/Hospitality_Catering/Beverage ...etcMy directory system in table category in MsAccess:CategoryID | CategoryTitle | ParentCategoryID | Description | Pagename26 &nbs p; Hospitality & Catering &nbs p; 0 ; ; Hospitality_Catering34 Berverage 26 &nbs p; Hospitality_Catering/BeverageAs see in index.asp :<a href="index.asp?cat=<%=CategoryID%>"><%=Category Title%></a>But now I change it. Instead of passing the Category id with querystring, I need to get the corresponding PageName and redirect to that page. Such as:<a href="<%=PageName%>"><%=CategoryTitle%></a >It will now redirect to:Category: www.cambodia-tourism.org/Hospitality_CateringNow I need to create the 404.asp page to handle all 404 page not found errors. 404.asp<%' Getting page namedim PageNamePageName = Request.ServerVariables("QUERY_STRING")%><%' Category iddim IDset obj = Server.CreateObject("ADODB.RecordSet")obj.Open "select CategoryID from TbleCategory where PageName = '"&PageName&"' ", DBConif not obj.EOF thenID = obj.Fields("CategoryID")%><%'Redirect ot Original PagetransferURL = "index.asp?cat=" + CStr(CategoryID)Server.execute(transferURL)%><%ElseError.aspEnd if%>I got some problem:ADODB.Recordset (0x800A0BB9)Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another./www.cambodia-tourism.ws/404.asp, line 10Can anyone resolve with this problem?.best regards

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...