[Lift] Re: Still confused about redirects

2009-01-24 Thread Tim Perrett
Chas, As it happens, I need to do this also. For me, im porting a rails app, so dont have the .html issues and im doing case by case redirects. So, I have something like: LiftRules.dispatch.prepend { case r @ Req(about :: Nil, , _) = () = Full (PermRedirectResponse(/about-us,r)) } However,

[Lift] Re: Still confused about redirects

2009-01-24 Thread Charles F. Munat
Yeah, except I'm concerned that if I do this, I'll end up with loops (or at least requests for index.html will be redirected). All my pages are index.html, and all the pages I need to redirect from are not. So I intended to do a regex that grabbed everything that ended in html but was not

[Lift] Re: Still confused about redirects

2009-01-24 Thread Tim Perrett
When you say all your pages are index.html, how do you mean? if your file is index.html, in lift the URI would be /index right? Anyway, this helps a lot. So if I want to redirect thebook.html to /the_book/ I would do this: LiftRules.dispatch.prepend {    case r @ Req(thebook :: Nil, html,

[Lift] Re: Still confused about redirects

2009-01-24 Thread Charles F. Munat
All my templates are index.html. I use the folder name. And I never call them by index (I rewrote the Menu functions to avoid that). So I call /the_book/ and I get /the_book/index.html. But if someone entered /the_book/index.html, I'd still want it to work. But you've made me realize that

[Lift] Re: Still confused about redirects

2009-01-24 Thread David Pollak
Charles, Place the following lines in Boot.scala: LiftRules.passNotFoundToChain = false LiftRules.uriNotFound.prepend { case (r, _) = PermRedirectResponse(/, r) } This will work in 0.11-SNAPSHOT (there was a bug in 0.10 that prevents it from working). Any URL not found will

[Lift] Re: Still confused about redirects

2009-01-24 Thread Charles F. Munat
Ah, that's a clever idea. Chas. David Pollak wrote: Charles, Place the following lines in Boot.scala: LiftRules.passNotFoundToChain = false LiftRules.uriNotFound.prepend { case (r, _) = PermRedirectResponse(/, r) } This will work in 0.11-SNAPSHOT (there was a bug

[Lift] Re: Still confused about redirects

2009-01-24 Thread David Pollak
On Sat, Jan 24, 2009 at 2:32 PM, Charles F. Munat c...@munat.com wrote: Ah, that's a clever idea. :-) Chas. David Pollak wrote: Charles, Place the following lines in Boot.scala: LiftRules.passNotFoundToChain = false LiftRules.uriNotFound.prepend { case (r,

[Lift] Re: Still confused about redirects

2009-01-23 Thread Charles F. Munat
Thanks! That helps. I'll try to figure it out. Chas. Marius wrote: LiftRules.prepend.dispatch is the right way. You pattern-match for *.html and return a PermRedirectResponse. Br's, Marius On Jan 23, 3:05 am, Charles F. Munat c...@munat.com wrote: I'm trying to do something dead