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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
"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 |
|
|||
|
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 |
|
|||
|
"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. |
|
|||
|
>> 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 |