List Info

Thread: url rewriting - undefinied number of parameters




url rewriting - undefinied number of parameters
country flaguser name
Switzerland
2007-06-22 11:54:09
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
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: url rewriting - undefinied number of parameters
country flaguser name
Switzerland
2007-07-03 06:03:10
Hey guys,
is there really no one that can point me the right
direction?

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://localhos
t/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
> Cherokeecherokee-project.com
> http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee
>   

_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: url rewriting - undefinied number of parameters
country flaguser name
United States
2007-07-03 16:13:56
Remo Laubacher wrote, On 03/07/07 13:03:

 > 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).

 > 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://localhos
t/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
 >> Cherokeecherokee-project.com
 >> http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee
 >>
 >
 > _______________________________________________
 > Cherokee mailing list
 > Cherokeecherokee-project.com
 > http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee
 >


-- 
Greetings, alo.
_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

Re: url rewriting - undefinied number of parameters
country flaguser name
Switzerland
2007-07-05 03:46:30
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://localho
st/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://localhos
t/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
> >> Cherokeecherokee-project.com
> >> http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee
> >>
> >
> > _______________________________________________
> > Cherokee mailing list
> > Cherokeecherokee-project.com
> > http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee
> >
>
>

_______________________________________________
Cherokee mailing list
Cherokeecherokee-project.com
http://cherokee-project.com/cgi-bin/mailman/listinf
o/cherokee

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )