Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: users

little problem with rewrite

 

 

Cherokee users RSS feed   Index | Next | Previous | View Threaded


s.rissmann at creadoo

Nov 20, 2009, 1:46 AM

Post #1 of 6 (441 views)
Permalink
little problem with rewrite

Hello,

just one little question about Regex:
i want to display the Profiles of my forums in a way like: http://www.domain.com/forum/profile/username/

Here is what i've tried:

Regex:
^/forum/profile/([^/]+)/(?:\?(.*))?$
Substitution:
forum/index.php?pretty;action=profile;u=$1;$2

This will only redirect me to the error Page of my server.

Any `ideas?

Regards
Sven


alvaro at octality

Nov 20, 2009, 1:53 AM

Post #2 of 6 (425 views)
Permalink
Re: little problem with rewrite [In reply to]

On 20/11/2009, at 10:46, creadoo - Sven Rißmann wrote:

> i want to display the Profiles of my forums in a way like: http://www.domain.com/forum/profile/username/
> Here is what i've tried:
>
> Regex:
> ^/forum/profile/([^/]+)/(?:\?(.*))?$
> Substitution:
> forum/index.php?pretty;action=profile;u=$1;$2

I'd use something like..

Regex: ^/forum/profile/(.+?)/
Substitution: /forum/index.php?pretty;action=profile;u=$1

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


s.rissmann at creadoo

Nov 20, 2009, 3:49 AM

Post #3 of 6 (413 views)
Permalink
Re: little problem with rewrite [In reply to]

Thanks for reply.
I'm sorry, but the effect ist the same. No changes. :(

Regards

Sven
----- Original Message -----
From: "Alvaro Lopez Ortega" <alvaro [at] octality>
To: "creadoo - Sven Rißmann" <s.rissmann [at] creadoo>
Cc: <cherokee [at] lists>
Sent: Friday, November 20, 2009 10:53 AM
Subject: Re: [Cherokee] little problem with rewrite


On 20/11/2009, at 10:46, creadoo - Sven Rißmann wrote:

> i want to display the Profiles of my forums in a way like:
> http://www.domain.com/forum/profile/username/
> Here is what i've tried:
>
> Regex:
> ^/forum/profile/([^/]+)/(?:\?(.*))?$
> Substitution:
> forum/index.php?pretty;action=profile;u=$1;$2

I'd use something like..

Regex: ^/forum/profile/(.+?)/
Substitution: /forum/index.php?pretty;action=profile;u=$1

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


alvaro at octality

Nov 20, 2009, 3:49 AM

Post #4 of 6 (415 views)
Permalink
Re: little problem with rewrite [In reply to]

On 20/11/2009, at 12:49, creadoo - Sven Rißmann wrote:

> Thanks for reply.
> I'm sorry, but the effect ist the same. No changes. :(

I'd recommend you to check the rules priority (order) then.

Remember; rules are evaluated from top to bottom. Once a 'Final' rule is matched, the evaluation stops. Otherwise, the behavior is accumulated and the evaluation of rules continues. Check this example: http://www.vimeo.com/7683565

> ----- Original Message -----
> From: "Alvaro Lopez Ortega" <alvaro [at] octality>
> To: "creadoo - Sven Rißmann" <s.rissmann [at] creadoo>
> Cc: <cherokee [at] lists>
> Sent: Friday, November 20, 2009 10:53 AM
> Subject: Re: [Cherokee] little problem with rewrite
>
> On 20/11/2009, at 10:46, creadoo - Sven Rißmann wrote:
>
>> i want to display the Profiles of my forums in a way like:
>> http://www.domain.com/forum/profile/username/
>> Here is what i've tried:
>>
>> Regex:
>> ^/forum/profile/([^/]+)/(?:\?(.*))?$
>> Substitution:
>> forum/index.php?pretty;action=profile;u=$1;$2
>
> I'd use something like..
>
> Regex: ^/forum/profile/(.+?)/
> Substitution: /forum/index.php?pretty;action=profile;u=$1
> _______________________________________________

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


john.m.alberts at gmail

Nov 20, 2009, 5:14 AM

Post #5 of 6 (424 views)
Permalink
Re: little problem with rewrite [In reply to]

On Fri, Nov 20, 2009 at 5:49 AM, Alvaro Lopez Ortega
<alvaro [at] octality> wrote:
> On 20/11/2009, at 12:49, creadoo - Sven Rißmann wrote:
>
>> Thanks for reply.
>> I'm sorry, but the effect ist the same. No changes. :(
>
> I'd recommend you to check the rules priority (order) then.
>
> Remember; rules are evaluated from top to bottom. Once a 'Final' rule is matched, the evaluation stops. Otherwise, the behavior is accumulated and the evaluation of rules continues. Check this example: http://www.vimeo.com/7683565

Nice video. That is a great way to show the power of Cherokee.

Regards,
John
_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee


s.rissmann at creadoo

Nov 20, 2009, 5:49 AM

Post #6 of 6 (418 views)
Permalink
Re: little problem with rewrite [In reply to]

Great Video, thanks!

But i think that the rules prioritys are OK.
All other stuff will work fine.
The order for the rewrites are set by default from cherokee, right?
So my default handler ist redirection and looks like this:

^/Content([1-9][0-9]*).* ==> artikel.php?id=$1

^/forum/([-_!~*'()$a-zA-Z0-9]+)/(?:\?(.*))?$ ==>
forum/index.php?pretty;board=$1.0;$2

^/forum/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/(?:\?(.*))?$ ==>
forum/index.php?pretty;board=$1.$2;$3

^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/(?:\?(.*))?$ ==>
forum/index.php?pretty;board=$1;topic=$2.0;$3

^/forum/([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/(?:\?(.*))?$

^/forum/profile/(.+?)/ ==> forum/index.php?pretty;action=profile;u=$1

This is the original order in my cherokee configuration. All substitutions
work but profiles.

Regards

Sven

----- Original Message -----
From: "Alvaro Lopez Ortega" <alvaro [at] octality>
To: "creadoo - Sven Rißmann" <s.rissmann [at] creadoo>
Cc: <cherokee [at] lists>
Sent: Friday, November 20, 2009 10:53 AM
Subject: Re: [Cherokee] little problem with rewrite


On 20/11/2009, at 10:46, creadoo - Sven Rißmann wrote:

> i want to display the Profiles of my forums in a way like:
> http://www.domain.com/forum/profile/username/
> Here is what i've tried:
>
> Regex:
> ^/forum/profile/([^/]+)/(?:\?(.*))?$
> Substitution:
> forum/index.php?pretty;action=profile;u=$1;$2

I'd use something like..

Regex: ^/forum/profile/(.+?)/
Substitution: /forum/index.php?pretty;action=profile;u=$1

--
Octality
http://www.octality.com/

_______________________________________________
Cherokee mailing list
Cherokee [at] lists
http://lists.octality.com/listinfo/cherokee

Cherokee users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.