Stefan Einspender: 401-Dokument wird nicht angezeigt (.htaccess)

Beitrag lesen

Hallo Christian,

PS: Warum 401 nie den kompletten Pfad (mit Hostname) zulässt,
    steht in dem von mir zuerst verlinkten Beitrag in der
    Apache-FAQ (Sicherheitsgründe).

Hmmm? Das hat weniger mit Sicherheitsgründen zu tun, als dass es anders einfach nicht funktionieren könnte.

dann formuliere ich es anders ... wenn jemand einen kompletten Pfad
bei einem ErrorDocument angibt, dann kann er zumindest dem Besucher
suggerieren, er hätte die Fehlerseite vor sich (so wie bei Dr. Web).
Diese "Täuschung" ist beim 401-Errordoc nicht möglich und dafür ist
eine mögliche Sicherheitslücke der Grund. Zumindest glaube ich mich
zu erinnern, dass Michael Schröpl sich mal diesbezüglich geäußert
hatte und ihm glaube ich da ;-)

Wieauchimmer, mit einem kompletten URL bekommt der Client nicht den
richtigen Fehlercode und genau darauf wird auch in Apache-Doku aus-
drücklich hingewiesen:

"Note that when you specify an ErrorDocument  that points to a remote URL (ie. anything with a method such as "http" in front of it), Apache will send a redirect to the client to tell it where to find the document, even if the document ends up being on the same server. This has several implications, the most important being that the client will not receive the original error status code, but instead will receive a redirect status code. This in turn can confuse web robots and other clients which try to determine if a URL is valid using the status code. In addition, if you use a remote URL in an ErrorDocument 401, the client will not know to prompt the user for a password since it will not receive the 401 status code. Therefore, if you use an "ErrorDocument 401" directive then it must refer to a local document."

Sorry für das lange Quoting, aber vielleicht hilft es ja, dass
dieser Unfug endlich aufhört ;-)

Besonders ärgerlich ist auch, wenn man sich vertippt, dann einen
"angeblichen" 404 bekommt und den Tippfehler in der Adresszeile
nicht mehr sehen kann, weil da ja die URL der Fehlerseite steht.

Viele Grüße,
Stefan