Mailing List Archive

ErrorDocument control from .htaccess files...
Hi,

08.8's http_core.c sez:

/* Note --- change the mask below, and ErrorDocument will work from
* .htaccess files. The question is, what AllowOverride should webmasters
* have to turn it off?
*/

so I turned:

{ "ErrorDocument", set_error_document, NULL, RSRC_CONF, RAW_ARGS, NULL },

into

{ "ErrorDocument", set_error_document, NULL, OR_ALL, RAW_ARGS, NULL },
^
^
put

ErrorDocument 404 http://somewhere/over/the/rainbow/

in /foo/bar/.htaccess, and fired up the URL:

http://there/foo/bar/duntexist.html

The result being that I get a redirect to http://somewhere/over/the/rainbow/
whenever I look in /foo/bar for a file that doesn't exist. This is useful
especially if you want to avoid having one huge script to handle error
redirection. The latter isn't really feasible when you're maintaining a
site with lots of different applications (and managers, and programmers)
who're all queueing up to add their own 3-line-hack to the system's
handle_error.pl script.

1) All this is to be expected, but am I going over the top by choosing
OR_ALL? Could I make do with a more restrictive OR_? (there isn't one
specific enough)

2) Uuuh, and yeah, could we end up getting a specific directive to
enable/disable this behaviour in the future, like, forinstance:

AllowOverride Errors

Consider this a +1 request for 0.8.8-and-a-bit ;)

Cheers,
Ay.

Andrew Wilson URL: http://www.cm.cf.ac.uk/User/Andrew.Wilson/
Elsevier Science, Oxford Office: +44 01865 843155 Mobile: +44 0589 616144
Re: ErrorDocument control from .htaccess files... [ In reply to ]
Date: Mon, 7 Aug 95 21:19:57 BST
From: Andrew Wilson <andrew@www.elsevier.co.uk>

[. Notes that ErrorDocument can be made to work in .htaccess files
simply by changing the overrides mask in the core command table
which says it isn't allowed there... ]

1) All this is to be expected, but am I going over the top by choosing
OR_ALL? Could I make do with a more restrictive OR_? (there isn't one
specific enough)

OR_ALL is going way overboard --- you're saying that if *anything* can
be overridden, then ErrorDocuments can be overriddent as well. What's
really needed here, as you suggest, is a new AllowOverrides option,
but we're outta bits in the bit mask (0.8.x inherits eight-bit
override masks from the old code base).

rst
Re: ErrorDocument control from .htaccess files... [ In reply to ]
Don't waste your time on 16-bit masks; take it to 32 bits if you're going
to extend it at all. I wouldn't want to play with this for 0.8.x, but it's
perfectly reasonable for further developments...

rst
Re: ErrorDocument control from .htaccess files... [ In reply to ]
> Date: Mon, 7 Aug 95 21:19:57 BST
> From: Andrew Wilson <andrew@www.elsevier.co.uk>
>
> [. Notes that ErrorDocument can be made to work in .htaccess files
> simply by changing the overrides mask in the core command table
> which says it isn't allowed there... ]
>
> 1) All this is to be expected, but am I going over the top by choosing
> OR_ALL? Could I make do with a more restrictive OR_? (there isn't one
> specific enough)
>
> OR_ALL is going way overboard --- you're saying that if *anything* can
> be overridden, then ErrorDocuments can be overriddent as well. What's
> really needed here, as you suggest, is a new AllowOverrides option,
> but we're outta bits in the bit mask (0.8.x inherits eight-bit
> override masks from the old code base).

Is moving to a 16-bit mask out of the question then, for the next set of
releases? For me, if ErrorDocument is to be of any great use then it should
be redefinable by entries in .htaccess files.

Would I be wasting my time investigating 16-bit masks further?

> rst

Ay.