So wie ich es der Häufigkeit an Suchergebnissen zuordnen kann, wird es meistens über Status Codes gemacht.
Nun hab ich geschaut welcher Statuscode denn dafür vorgesehen ist, wobei ich aber mehrere herausbekam:
Code:
401 Unauthorized
The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. HTTP access authentication is explained in "HTTP Authentication: Basic and Digest Access Authentication" [43].
408 Request Timeout
The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.
412
Precondition Failed: Die in einem oder mehreren Anfrage Headern gegebenen Bedingungen wurden beim testen auf dem Server als falsch oder nicht erfüllbar eingestuft. Dieser Antwortcode erlaubt es dem Client anhand der Metainformationen der aktuellen Ressource Bedingungen zu stellen und dadurch die Anfragemethode vor der Anwendung auf eine falsche Ressource zu beschützen.
Wobei mir "Request Timeout" wohl eher gemeint ist, wenn die Verbinung zu lange zum Server dauert und nicht "Solange keine Verbindung zum Server erfolgt ist und dadurch ein Session Timeout entsteht".
Wobei der 401er doch bei unerfolgreichen htaccess Anmeldungen gesendet wird, oder ?
Als Header wird sonst immer der Statuscode 200 für OK gesendet.
Also was ist empfehlenswerten bzw "state of the art" ?
Ein User Defined Header oder ein bereits vorhandener Statuscode ?
Wobie die zweite Frage dann *hoch* schaut, ob die von mir genannten überhaupt dafür gedacht sind oder sie "fremdverwendet" werden.
P.S.:
Dein Workaround ist richtig klasse, du inspirierst mich meistens aufs Neues
