Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
404 Errors 404 error with asp cmatcme msg:952593 9:34 am on Feb 19, 2005 (gmt 0) How do you create 404 errors with asp?
Jalinder msg:952594 1:35 pm on Feb 19, 2005 (gmt 0)
if you mean how to handle 404 errors, here's a method: IIS -> site -> properties -> custom error -> 404 -> edit properties. Here you can make setting like: Message Type: URL URL: /directoryname/404.asp
This will execute your directoryname/404.asp when there is invalid URL request. You can do your coding in your 404.asp. Invalid url string is available by request.ServerVariables("QUERY_STRING")
topr8 msg:952595 1:38 pm on Feb 21, 2005 (gmt 0)
don't think that was what was meant.
how do you return a 404 from within an asp page
eg. pseudo code
IF [i don't want you to look at my page condition] TRUE THEN
return 404 to the browser ELSE return content END IF
currently i'm doing this by response.redirect to a non existant page which fires a 404 error,
but i'm sure there is a better and more elegant way.
fabfurs msg:952596 2:00 pm on Feb 21, 2005 (gmt 0)
Could you be looking for this: <% Response.Status = "404 Not Found" %> topr8 msg:952597 2:17 pm on Feb 21, 2005 (gmt 0)
that does it for me!