ODBiC Discussion Board


RE: Force Response Code?, Adrian Fitton, 12-11-2009

It depends on the server, but try this

by Roger Harris, December 22, 2009 20:14

This should work with IIS (but make sure that there is no other output before this):

<% header "HTTP/1.1 404 Not found" %>
<% header "" %>
If that doesn't work, some servers will work with this:
<% header "Status: 404 Not found" %>
<% header "" %>
Or, it apparently doesn't hurt to use both, with the HTTP first:
<% header "HTTP/1.1 404 Not found" %>
<% header "Status: 404 Not found" %>
<% header "" %>
IIS, at least, doesn't allow setting all of the possible HTTP response codes, but it does allow the "404 Not found" and "401 Unauthorized" which are the only two I've had a need for. I'm not sure about other servers.



Replies:


Post Your Reply:

Name   
E-mail  optional
Topic  
Message:

HTTP Link: 
Link text: 

          


Copyright ©1997-2003, Roger Harris. All rights reserved.