You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tom Myny <to...@pandora.be> on 2002/06/08 18:45:15 UTC

Mod_rewrite problem

Hi,

When i set the following line in my apache config:

RewriteRule ^/admin(|/.*)$ /admin.php

Apache says on start-up: RewriteRule: cannot compile regular expression '^/admin(|/.*)$'

When i use this line on a redhat 7.2 apache server it works, but on my self-compiled apache 1.3.24 not :(

Mod_rewrite is compiled without DBM support (altough db-4.0.14. is installed), maybe it's that ?


Greetz,
Tom

Re: Mod_rewrite problem

Posted by Joshua Slive <jo...@slive.ca>.

On Sat, 8 Jun 2002, Tom Myny wrote:

> I'm not sure, its given to install openstats ( http://www.openstats.org ) -
> http://www.openstats.net/docs/install.phtml

> > > RewriteRule ^/admin(|/.*)$ /admin.php

Frankly, I'd think seriously about using a different log analysis package.
I don't know anything about openstats, but skimming the page you reference
shows several major problems:

1. The regex above, which is garbage.

2. They tell you to use <Limit GET POST> ... which is wrong and possibly a
security risk.

3. They tell you to use "HostNameLookups On" which is stupid, because it
will slow down your server and can easily be replaced by a post-processor.

4. Their site comes with a default administrative password enabled.

If you still want to use it, then to solve your immediate problem, just
use the simpler regex I mentioned in the last message.  It should work
fine.

Joshua.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Mod_rewrite problem

Posted by Tom Myny <to...@pandora.be>.
I'm not sure, its given to install openstats ( http://www.openstats.org ) -
http://www.openstats.net/docs/install.phtml

----- Original Message -----
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Saturday, June 08, 2002 6:57 PM
Subject: Re: Mod_rewrite problem


>
> On Sat, 8 Jun 2002, Tom Myny wrote:
> > RewriteRule ^/admin(|/.*)$ /admin.php
> >
> > Apache says on start-up: RewriteRule: cannot compile regular expression
> > '^/admin(|/.*)$'
> >
> > When i use this line on a redhat 7.2 apache server it works, but on my
> > self-compiled apache 1.3.24 not :(
> >
> > Mod_rewrite is compiled without DBM support (altough db-4.0.14. is
installed), maybe it's that ?
> >
>
> No.  The DBM is not the issue.  The issue is that, depending on how you
> compile apache, it will either use the system-provided regex library, or a
> bundled regex library (HSRegex in 1.3, PCRE in 2.0).  So, you could figure
> out which one redhat is using and make sure use the same one.
>
> But instead of doing that, why don't you fix your RewriteRule.  What is
> that RewriteRule supposed to do?  I'm moderately good at these things, and
> I can't understand the point of that at all.
>
> Perhaps what you want is
> RerwiteRule ^/admin(/?.*)$ /admin.php
> but since you aren't using the reference, you can just use
> RewriteRule ^/admin.* /admin.php
>
> If that isn't what you want, please explain in words what you want the
> regex to match.
>
> Joshua.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Mod_rewrite problem

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 8 Jun 2002, Tom Myny wrote:
> RewriteRule ^/admin(|/.*)$ /admin.php
>
> Apache says on start-up: RewriteRule: cannot compile regular expression
> '^/admin(|/.*)$'
>
> When i use this line on a redhat 7.2 apache server it works, but on my
> self-compiled apache 1.3.24 not :(
>
> Mod_rewrite is compiled without DBM support (altough db-4.0.14. is installed), maybe it's that ?
>

No.  The DBM is not the issue.  The issue is that, depending on how you
compile apache, it will either use the system-provided regex library, or a
bundled regex library (HSRegex in 1.3, PCRE in 2.0).  So, you could figure
out which one redhat is using and make sure use the same one.

But instead of doing that, why don't you fix your RewriteRule.  What is
that RewriteRule supposed to do?  I'm moderately good at these things, and
I can't understand the point of that at all.

Perhaps what you want is
RerwiteRule ^/admin(/?.*)$ /admin.php
but since you aren't using the reference, you can just use
RewriteRule ^/admin.* /admin.php

If that isn't what you want, please explain in words what you want the
regex to match.

Joshua.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org