when I am requesting an invalid url from CQ I see the following line in the access log
xx.xx.xx.xx - anonymous 13/Jun/2012:23:38:47 +0000 "GET xxxxxxxxx.html HTTP/1.1" 200 371 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5"
Note that that 200 http code was returned. Is this a known issue with CQ?
Ideally a 404 would be retunred, right?
in additon, on the broswer I get this:
The requested URL /system/sling/cqform/defaultlogin.html was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This tells me maybe we are missing some setup to handle the 404s
Do you have a custom 404 (JSP) handler, as described at the following? http://dev.day.com/docs/en/cq/current/developing/customizing_error_handler_pages.html
Also, does this related thread help? http://dev.day.com/discussion-groups/content/lists/cq-google/2010-02/2010-02-11__day_commu nique_Sling_error_pages_zambak.html
This bit might be relevant:
You are correct to not use redirect since redirect sends back a 302
status with a Location: header which causes the browser to request the
new location which is returned with 200 status.
So forward is correct. But you should call
HttpServletResponse.setStatus(int status) in your error handler to make
sure the correct status is set on the response.
By default the Author environment always returns a status code of 200 for a url request. the Publish instance will report a 404.