Alvaro Lopez Ortega wrote:
> > is there really no one that can point me the right direction?
>
> I would rather use a couple of Request entries. Something like:
>
> Request "/photo/(\d+)\.html\?(.*)$" {
> Show Rewrite "/viewphoto.html?id=$1&$2"
> }
>
> .. and remember the priority (first entry is the highest priority).
Thanks for your answer!
I've tried that as well but also without much success as soon as there
are more than 2 parameters.
This time the regex matches the url, but it don't passes the parameters
to the new location!
Request "/photo1/(\d+)/(\d+)\.html\?(.*)$" {
Handler redir {
Show Rewrite "/viewphoto.html?id=$1&foo=$2&$3"
}
}
#http://localhost/photo1/5/11.html?asdf
Request "/photo2/(\d+)\.html\?(.*)$" {
Handler redir {
Show Rewrite "/viewphoto.html?id=$1&$2"
}
}
#http://localhost/photo2/11.html?asdf
>
> > I've been trying some new things, but still without much success.
> > The first handler (photo1) works perfect, but the second one always
> > generates this message: "handler_redir.c:206: Too many groups in the
> > regex" and I only get a 404 page back..
> >
> > Thanks!
> > Remo
> >
> > Directory /photo1 {
> > Handler redir {
> > Show Rewrite "/(\d+)\.html\?(.*)$" "/viewphoto.html?id=$1&$2"
> > }
> > }
> > Directory /photo2 {
> > Handler redir {
> > Show Rewrite "/(\d+)/(\d+)\.html\?(.*)$"
> > "/viewphoto.html?id1=$1&id2=$2&$3"
> > }
> > }
> > http://localhost/photo1/1.html?sadf
> > http://localhost/photo2/1/1.html?sadf
> >
> >> Hi Cherokee Fans!
> >>
> >> I'm trying to create a redirect for these urls:
> >> foo/index.php?project=test&template=page
> >> foo/index.php?project=test&template=page&var1=1
> >> foo/index.php?project=test&template=page&var1=1&var2=2
> >>
> >> As you can see, only project and template are always there, the
> rest of
> >> should directly be passed to index.php. The new urls should look
> like this:
> >> redir/test/page.html
> >> redir/test/page.html?var1=1
> >> redir/test/page.html?var1=1&var2=2
> >>
> >> I've tried several things, but never with a lot of success.
> >>
> >> Redir "^/(.+)/(.+)\.html(.+)$"
> "/test/index.php?project=$1&template=$2$3"
> >>
> >> Thanks for any hint!
> >> Remo
> >>
> >> _______________________________________________
> >> Cherokee mailing list
> >> [email protected]
> >> http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee
> >>
> >
> > _______________________________________________
> > Cherokee mailing list
> > [email protected]
> > http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee
> >
>
>
_______________________________________________
Cherokee mailing list
[email protected]
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee