Forum Moderators: open

Message Too Old, No Replies

404 ASP Custom Error Page

Using for creating static pages from database

         

instabill

5:19 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, that Google will recognize as a 404 error.

Thanks for any help!

Bill

wardbekker

1:25 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



Hi Bill,

Some code;:

IF Real404Error = True Then
Response.Status = "404 Not Found"
Response.Write(" the 404 error page html code ")
Response.end
END IF

macrost

2:17 am on Mar 17, 2003 (gmt 0)

10+ Year Member



Ward,
Just a real quick question, what would go in lieu of the Real404Error? Or a better way, what would be assigned to it?
Thanks!
Mac

wardbekker

7:20 am on Mar 17, 2003 (gmt 0)

10+ Year Member



macrost,

You could include the HTML code of a normal 404 page. Like [webmasterworld.com ] for example

chicagohh

4:58 am on Mar 19, 2003 (gmt 0)

10+ Year Member



Maybe I am missing something, but it seems that you could just remove your old code and let the server just send up the default 404 page...

graywolf

4:20 am on Mar 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Serving a custom 404 has a lot of advantages.

1.You can log them and fix them.
2.You can keep them on site
3.You look at where they were trying to go, and suggest a page
(they may have typed dlivery.asp instead of delivery.asp)

You really should tell them what happened and what they should/can do, rather than redirecting them automatically .Imagine if you entered a physical store and were suddenly wisked away to the shoe department