[plug] mod_rewrite: Out of chickens! (OT)

James Devenish devenish at cyllene.uwa.edu.au
Wed Jan 29 17:39:10 WST 2003


On Wed, Jan 29, 2003 at 10:39:46AM +0800, Trevor Phillips wrote:
> > But I'm guessing that if you move your mod_rewrite rules somewhere
> > else, like into the enclosing <VirtualHost> or host block (or maybe
> > even into an .htaccess file -- urgh), the rewriting will work as
> > intended. If you refuse to do that,...any takers?
>
> I don't think so. It seems if there's any overlap with the cgi-bin dir (or any 
> dir without Options FollowSymLinks or SymLinksIfOwnerMatch, it balks.

Except that you are putting your rewrite rules in a <Directory> block,
which would suggest to me that they are being considered mandatorily
when Apache needs to resolve access privileges for filesystem resources
that exist within the directory stem. So when you want /blah/cgi-bin,
rules for /blah/ must be evaluated (since if users are forbidden from
accessing the /blah/ filesystem hierarchy, they are also forbidden from
accessing /blah/a and /blah/b, etc). Therefore, your rewrite rules are
being considered when you request /blah/cgi-bin. On the other hand, if
you put your rewrite rules outside of the <Directory> block, the rewrite
would be considered at some different stage of processing. Maybe this is
what you were getting at when you said that you actually wanted to keep
things as the file level rather than URL level. (Aha, so perhaps we were
actually thinking along the same lines?) Maybe a case of wanting to have
your cake and eat it too? Glad you found a working solution, though.

But by the way, you didn't mention to us that the URLs you wanted to
rewrite actually corresponded to filesystem resources that Apache would
find in the absence of those rewrite rules. Little facts like your
current configuration can be of assistance if you want help with said
configuration.

PS. I say this with confidence because I just tested it using an
almost-default Apache 1 installation. If I move cgi-bin inside htdocs
that's fine. If I add a rewrite rules inside <Directory ...htdocs> then
I get the error you got. If I move the same rewrite rules to one level
above the <Directory> block, it works as far as I can tell.




More information about the plug mailing list