First, I rewrite URLs like /user/harryh to /user?uid=harryh
Also, requests to http://m.harryh.org/foo/bar get rewritten to /
subdomain/mobile/foo/bar

Doing this with the following code:

val urlRewriter: LiftRules.RewritePF = NamedPF("URLRewrite") {
  case RewriteRequest(ParsePath("user" :: uid :: Nil, _, true, _), _,
_) => {
    RewriteResponse(ParsePath("user" :: Nil, "", true, false), Map
("uid" -> uid))
  }

  case RewriteRequest(path, _, req) if
(req.serverName.toLowerCase.startsWith("m.")) => {
    RewriteResponse(ParsePath("subdomain" :: "mobile" ::
path.partPath, path.suffix, path.absolute, path.endSlash), emptyMap,
true)
  }
}

LiftRules.rewrite.append(urlRewriter)

The problem is that emtyMap in the second RewriteResponse.  The
uid=harryh parameter that gets created by the first rewrite rule is
being destroyed at which point bad things happen.

Is there a better way to do what I am trying to do here?

-harryh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to