httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: mod_rewrite && apache 2 problem
Date Tue, 21 May 2002 14:39:02 GMT

On Tue, 21 May 2002, Marten Lehmann wrote:

> > A couple general hints:
> >
> > 1. Use the RewriteLog to debug!
> as you can read some mod_rewrite related postings before, mod_rewrite
> seems so have a lock-problem in apache 2.

Only on very particular systems.  This problem is fixed in the next
version.  You can get a test release from

It is really pretty much impossible to debug complicated mod_rewrite
configurations without using the rewritelog.

> > 3. I'm not sure where the {4} comes from.  I certainly don't see it in the
> > mod_rewrite docs.
> Sure it does, thats part of a regular expression. [a-z0-9]{4} means,
> that there have to be 4 characters each containing only chars from a to
> z and digits from 0 to 9.

Not all regexes are alike.  Although I believe you are right that the {}
notation is supported in 2.0 because of the use of PCRE.

> > Now, here is a guess that simplifies things:
> >
> > RewriteEngine On
> > RewriteBase /
> > RewriteRule ^/sess/[a-z0-9][a-z0-9][a-z0-9][a-z0-9]/(.*) /apps/$1 [L]
> > RewriteCond %{REQUEST_URI} !^/soap/
> > RewriteCond %{REQUEST_URI} !^/redirect/
> > RewriteRule ^.* /redirect/
> Unfortunatly even this doesn't work. Maybe apache 2 is just to buggy at
> this time, I will try with apache 1.3.24 now, I hope that works.

mod_rewrite is complicated.  Don't expect to be able to figure it out in
30 seconds.  Also, it is usually much easier to put the rewrite rules in
httpd.conf in the main server context (outside any directory sections)
so that you don't have to worry about fooling around with RewriteBase,
which might very well be the cause of your problems.
Finally, try slowing down and getting each of these parts to work
one at a time before putting them all together.  Your problem is not
particularly nasty, so you should be able to make it work.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message