Hello Léon,
The rough idea is:
- Extensions: php, Handler: fcgi, Final
- File Exist: Any, Handler: file, Final
- Default: Redirection /(.*)$, Substitution: /index.php?$1
Remember that the order of the rules does matter. They are matched from top to
bottom of the list until a Final rule is matched or 'Default' is reached.
Cheers!
On 19/02/2011, at 14:20, Léon Dignòn wrote:
> Hello Alvaro,
>
> in short: "domain.com/path" or "domain.com/path/subpath" should
> always
> redirect to "/index.php?p1=$1&p2=$2" unless the file is a jpg and
> does
> exist on the path. That'd be the case when requesting
> "domain.com/imgpath/image-0001.jpg". All of that is working, when I
> change "vserver!30!rule!120!match!request = ^/.*$" to "... = ^/....
> $",
> but only when opening a path with exactly 4 letters
> ("domain.com/path").
>
> I very very much appreciate your help!
>
> Léon
>
> P. S.
> Here is the cofiguration of my vserver:
> vserver!30!directory_index = index.php
> vserver!30!document_root = /var/www/domain.com
> vserver!30!match = rehost
> vserver!30!match!regex!1 = ^(www\.)?domain.com$
> vserver!30!nick = domain.com
> vserver!30!rule!220!disabled = 0
> vserver!30!rule!220!handler = file
> vserver!30!rule!220!match = extensions
> vserver!30!rule!220!match!check_local_file = 0
> vserver!30!rule!220!match!extensions = jpg
> vserver!30!rule!220!match!final = 0
> vserver!30!rule!120!disabled = 0
> vserver!30!rule!120!handler = redir
> vserver!30!rule!120!handler!rewrite!10!regex = /(.+?)(?:/(.*?)
> (?:/.*)?)?$
> vserver!30!rule!120!handler!rewrite!10!show = 0
> vserver!30!rule!120!handler!rewrite!10!substring = /index.php?p1=$1&p2=
> $2
> vserver!30!rule!120!match = request
> vserver!30!rule!120!match!final = 0
> vserver!30!rule!120!match!request = ^/.*$
> vserver!30!rule!20!disabled = 0
> vserver!30!rule!20!encoder!gzip = 1
> vserver!30!rule!20!handler = fcgi
> vserver!30!rule!20!handler!balancer = round_robin
> vserver!30!rule!20!handler!balancer!source!10 = 1
> vserver!30!rule!20!handler!error_handler = 1
> vserver!30!rule!20!match = extensions
> vserver!30!rule!20!match!check_local_file = 1
> vserver!30!rule!20!match!extensions = php
> vserver!30!rule!20!match!final = 1
> vserver!30!rule!20!timeout = 30
> vserver!30!rule!10!handler = file
> vserver!30!rule!10!match = default
>
> On 17 Feb., 06:57, Alvaro Lopez Ortega <[email protected]> wrote:
>> On 16/02/2011, at 23:18, Léon Dignòn wrote:
>>
>>> I have a Regex behaviour targetting: ^/.*$
>>> But I always get a 500 error. Wierd because ^/....& is working prefectly.
>>
>> Both are perfectly valid regular expressions.
>> Please, attach your configuration file for review, the problem might not be
>> the regex itself.
>>
>> --
>> Octalityhttp://www.octality.com/
>>
>> _______________________________________________
>> Cherokee mailing list
>> [email protected]http://lists.octality.com/listinfo/cherokee
> _______________________________________________
> Cherokee mailing list
> [email protected]
> http://lists.octality.com/listinfo/cherokee
--
Octality
http://www.octality.com/
_______________________________________________
Cherokee mailing list
[email protected]
http://lists.octality.com/listinfo/cherokee