By Date: <-- -->
By Thread: <-- -->

404 errors



"Marcel van der Boom" <marcel (at) hsdev.com> wrote in message 
news:eil46c$dk$1 (at) newton.xaraya.com...
> Jason wrote:
>> I think we need better HTTP code support somewhere in the core. If a 
>> module believes an item being displayed is no longer available, then it 
>> should be able to return a 404. Similarly, permissions errors, moved 
>> items, unexpected errors etc. should all return the appropriate HTTP 
>> code. This does no mean the user error should not be displayed, as that 
>> can be displayed as well.
>>
> Should be doable but its hard to come up with one global setting i think. 
> It's value is part of the request-answer game we're playing, where the 
> default answer is usually 200 (as in: all OK). The answer is part of the 
> whole answer we put so much work in to construct, run the api, build the 
> data, get the right template and sent it off.
>
> The result code should be configurable for a number of situations. 
> Redirect may be 301 (permanent) or 302 (temporary), exceptions may be 404 
> (not found), no privilege for this (403?, 405? both?) or 500 (boom!) or 
> whatever we would like.

An example I've been working on would be a download page 
(http://www.iema.net/index.php/envdload) where you need appropriate 
privileges to download a file. If you are logged on, then you just get the 
PDF downloaded directly. If you are not logged in (or don't have the 
privileges) then you are sent to a login page. I'm not sure if the redirect 
to the login page should be a 302 (temporary) with a 200 at the over end, or 
perhaps a 301 (permanent) with a 403 (no privilege) along with it. The main 
thing is, these pages are not fatal errors, so the page rendering etc. does 
not stop, but we do need to indicate to the search engines indexing these 
pages, that the pages it sees is not actually what the end user may see.

(In fact, there is another level to these download permissions - I allow the 
local search engine to bypass the permissions, so the documents can be 
indexed, even if they cannot be publically read).

> I think we only play with it in cache parts (304?) and perhaps uploads 
> module. I suspect our default redirect is 302?
> IIRC there's also the option to return multiple status codes?

Oooh. It gets more complicated.

> Additionally, related to this, is better HTTP header control in general.
>
> All in all, food for thought. I havent dived in recently.
>
> marcel

Yep - just throwing out ideas. Probably won't come back to this for a while.

-- JJ


_______________________________________________
Xaraya_devel mailing list
Xaraya_devel (at) xaraya.com
http://xaraya.com/mailman/listinfo/xaraya_devel