mod_rewrite cannot compile error

This is a discussion on mod_rewrite cannot compile error within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi, Compiling Apache 1.3.29 on a gentoo box everything seems to work as usual but for mod_rewrite. It ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-01-2004
Gerhard Hoogterp
 
Posts: n/a
Default mod_rewrite cannot compile error

Hi,

Compiling Apache 1.3.29 on a gentoo box everything seems to work as usual
but for mod_rewrite. It refuses to compile a completely acceptable (and
actually used on the previous install and some other boxes with the same
apache version, but RedHat 9)

The problem lays in the next two lines:

RewriteCond %{REQUEST_URI} !^/ariadne

RewriteRule ^(/-[^/]{4}-/|)?([a-z]{2}/|/)
(.*) /ariadne/loader.php$1$2sites/happysite/$3

Where the last is 1 line. I tracked the error down to the use of the |
symbol. ^(/-[^/]{4}-/) is accepted.

The error:

Syntax error on line 27 of /etc/apache/conf/vhosts/muze.conf:
RewriteRule: cannot compile regular expression '^(/-[^/]{4}-/|)?([a-z
{2}/|/)?(.*)'

Anyone an idea? Or suggestions on what the problem could be?

Thanks, Gerhard
  #2 (permalink)  
Old 04-01-2004
HansH
 
Posts: n/a
Default Re: mod_rewrite cannot compile error

"Gerhard Hoogterp" <gerhard@frappe.xs4all.nl> schreef in bericht
news:3685491.4NkuU0nE6k@frappe.xs4all.nl...
> Hi,
> The error:
>
> Syntax error on line 27 of /etc/apache/conf/vhosts/muze.conf:
> RewriteRule: cannot compile regular expression '^(/-[^/]{4}-/|)?([a-z
> {2}/|/)?(.*)'

Why is there nothing between the first | and ) following ??
Missing slash I presume, comparing first half and second half

HansH


  #3 (permalink)  
Old 04-02-2004
Gerhard Hoogterp
 
Posts: n/a
Default Re: mod_rewrite cannot compile error

HansH wrote:

> "Gerhard Hoogterp" <gerhard@frappe.xs4all.nl> schreef in bericht
> news:3685491.4NkuU0nE6k@frappe.xs4all.nl...
>> Hi,
>> The error:
>>
>> Syntax error on line 27 of /etc/apache/conf/vhosts/muze.conf:
>> RewriteRule: cannot compile regular expression '^(/-[^/]{4}-/|)?([a-z
>> {2}/|/)?(.*)'

> Why is there nothing between the first | and ) following ??
> Missing slash I presume, comparing first half and second half


Because the url starts with /-xxxx-/ or not. Then it gets a 2 character
language identifier (or not) and then ther rest..
Trust me, the regexpr is correct as such and working on many sites. It's
just this compile that has a problem.

Gerhard
  #4 (permalink)  
Old 04-02-2004
HansH
 
Posts: n/a
Default Re: mod_rewrite cannot compile error

"Gerhard Hoogterp" <gerhard@frappe.xs4all.nl> schreef in bericht
news:1310690.1GDg1Z3VoB@frappe.xs4all.nl...
> HansH wrote:
> > "Gerhard Hoogterp" <gerhard@frappe.xs4all.nl> schreef in bericht
> > news:3685491.4NkuU0nE6k@frappe.xs4all.nl...
> >> Syntax error on line 27 of /etc/apache/conf/vhosts/muze.conf:
> >> RewriteRule: cannot compile regular expression '^(/-[^/]{4}-/|)?([a-z
> >> {2}/|/)?(.*)'

> > Why is there nothing between the first | and ) following ??
> > Missing slash I presume, comparing first half and second half

> Because the url starts with /-xxxx-/ or not.

It's the ? fulfilling the '(once) or not' ...
.... why bother to do the failing -and redundant- 'or nothing' ????

> Then it gets a 2 character language identifier (or not) and then the

rest..
> Trust me, the regexpr is correct as such and working on many sites.

I'ld like to take your word for that ...
.... though if your path format realy varies like this:
/-xxxx-/cc/abcdefg
/cc/abcdefg
/abcdefg
and is to be translated to
/ariadne/loader.php/-xxxx-/cc/sites/happysite/abcdefg

It is my understanding only the first can ever match ...
.... because the first pair of brackets do not eat *just* the leading slash,
unless you put it there as you did inside the second pair of brackets.

> It's just this compile that has a problem.

Dark clouds of (in)compatibility are hiding the moon ...
.... just give it a try without the first | or with the extra /
.... or even try this
RewriteRule
^(/-[^/]{4}-)?(/[a-z]{2})(/.*)
/ariadne/loader.php$1$2/sites/happysite$3



HansH
--
Never change the winning horse ...
.... but after loosing the game.


  #5 (permalink)  
Old 04-05-2004
Gerhard Hoogterp
 
Posts: n/a
Default Re: mod_rewrite cannot compile error

>> It's just this compile that has a problem.
> Dark clouds of (in)compatibility are hiding the moon ...
> ... just give it a try without the first | or with the extra /
> ... or even try this
> RewriteRule
> ^(/-[^/]{4}-)?(/[a-z]{2})(/.*)
> /ariadne/loader.php$1$2/sites/happysite$3



Well, solved my problem in a easier way. Just installed Apache2 and yes, the
mod_rewrite there accepts the regexpr as it should (correct or not, it IS
working on at least 3 other servers running the latest apache under redhat
7.2, 7.3 and 9.0..)

But it remains a mystery why it didn't work under gentoo apache1..

Thanks,
Gerhard
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:03 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0