Ticket #198 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Return a proper 404 when we hit a missing document

Reported by: mbonetti Owned by: mbonetti
Priority: high Milestone: Gregarius 0.5.5
Component: BUGS Version:
Severity: normal Keywords: 404
Cc:

Description

Currently we're redirecting to the front page with a 302 when we hit a missing document. We should probably return a nice message explaining the item/feed/whatever was deleted/removed along with a HTTP/404 error

Change History

Changed 3 years ago by mbonetti

  • priority changed from normal to high
  • status changed from new to assigned
  • milestone changed from Gregarius 0.5.2 to Gregarius 0.5.3

This is quite important re: bandwidth.

Changed 3 years ago by anonymous

More important.. google can ban you for duplicate content

Changed 3 years ago by jake@…

I'm looking through the code in feed.php to see if I can work this out myself, as I've been banned before (not this site, another one) and don't want to go through it again. On other database driven sites that I had error checking like this in there, and I just threw headers up before including my 404 page (not doing a redirect, as the returned HTTP headers are 302 then, which doesn't help):

header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); include ("/home/blahblah/www/404.php"); exit;

Looking at the returned HTTP headers, it's a valid 404 now.

Obviously, with all the work you're doing in .htaccess, you simple can't throw down an ErrorDocument? declaration and have it work properly. This obviously has to be done in feeds.

Changed 3 years ago by sdcosta

  • status changed from assigned to closed
  • resolution set to fixed

Better to use a 404 instead of a 410 (Gone) as we dont know if the url existed in the past.

Fix in [1350]

Note: See TracTickets for help on using tickets.