Forum Moderators: open

Message Too Old, No Replies

Help with Custom 404.ASP Error Page

Currently redirecting to the home page

         

instabill

2:54 am on Mar 13, 2003 (gmt 0)

10+ Year Member



I have read some threads here that suggest that I discontinue the practice of redirecting page not found errors using a custom 404 page to the home page, and instead should display a true 404 error page. I am not sure how to do this.

My current custom 404.asp page was built originally to build dynamic static pages because Google won't index my long query string URL's. This has been working great and most of products are now indexed because of this custome script.

I currently use the following to redirect users to the home page in the event that the page doesn't exist or can't be generated dynamically from the database.

Response.Redirect "/"

What should I replace that line of code with to generate a page not found error with the correct header.

Thanks for any help!

Bill

instabill

2:50 pm on Mar 13, 2003 (gmt 0)

10+ Year Member



Help!

Dreamquick

3:18 pm on Mar 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In ASP to have the script report a "true" 404 you need to do something along the lines of;


<%
Response.Status = "404 Page not found"
%>
Hi you've reached my custom 404 page. We couldnt find what you asked for, however try looking here;

<<link>>

Where everything after the code block ends is just normal HTML content

- Tony