You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Liam Morley <lm...@WPI.EDU> on 2001/10/09 10:33:46 UTC

mod-rewrite troubles (formerly RE: how to get "dir-name/" to point to "dir-name/index.html")

Nikola,

Thank you very much for your help thus far- that was a great assistance.
I'm currently having some troubles with mod_rewrite. It seems that when
I try the following:

RewriteRule mydir/(.*) cocoon/mydir/$1 [PT]

I get a "HTTP 400 - Bad Request" response after trying to access
http://localhost/mydir/. If I try http://localhost/mydi/ instead, I get
the proper HTTP 404. Could anybody shed some light on this?

Also, Nikola, you said that "If they are not real directories - then you
should just write a regexp that looks for that pattern ^(.+[^/])$ except
explicitly say what the directory is." Do you mean something like this:

RewriteRule    mydir$           mydir/ [R]
RewriteRule    mydir/subdir1$   mydir/subdir1/ [R]
RewriteRule    mydir/subdir2$   mydir/subdir2/ [R]

Or perhaps something like:
RewriteRule    ^(.+[^(?:\.html)])$    $1/ [R]

What I was trying to say there (and I hope it came out right) is that
anything that doesn't end with ".html" will be redirected to include a
slash after it. Would that work, do you think? Again this is all
hypothetical at the moment as I'm still getting "HTTP 400 - Bad Request"
messages. The Rewrite log does seem to indicate the request is being
handled correctly and that the correct message is being passed
afterwards (at least, I think so)...

Thanks again, you've been an incredible help.

Liam Morley


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>