Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6344905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:43:43+00:00 2026-05-24T20:43:43+00:00

I have the following rewrite in Boot.boot(). This is based on the instructions found

  • 0

I have the following rewrite in Boot.boot(). This is based on the instructions found in the URL Rewriting section in the Lift Wiki.

LiftRules.statefulRewrite.prepend(NamedPF("CreateAndEditRewrite") {
  case RewriteRequest(
        ParsePath("models" :: "createEdit" :: state :: Nil, _, _,_), _, _) => {
      Console.println("Rewriting path: models/createEdit/Create to createEdit.html")
      val rewriteResp = RewriteResponse(
        "models/createEdit" :: Nil, "html" // Use webapp/models/creteEdit.html
      )
      Console.println("Response refers to URL " + rewriteResp.path + " with parameters " + rewriteResp.params.toList.map(x => "" + x.key + "=" + x.value + ", "))
      rewriteResp

  }
})

To make sure everything is accessible a made sure SiteMap permitted access to “models/createEdit/create” and “models/createEdit” with the following lines.

val entries =
     Menu(Loc("models", List(""), "Models"),
         Menu(Loc("createEditM", List("models","createEdit","Create"), "[NEW]Create Model", loggedIn)),
         Menu(Loc("createEditMXX", List("models","createEdit"), "[NEW]Create Model", loggedIn)) ) ::
     User.sitemap

// Build SiteMap
LiftRules.setSiteMap(SiteMap(entries:_*))
LiftRules.passNotFoundToChain = true //if a URL isn't found pass responsability to the container

Yet, the second menu option works while the first yelds a “HTTP ERROR 404
Problem accessing /models/createEdit/Create” on the container level.

The following println appear on the console

Rewriting path: models/createEdit/Create to createEdit.html
Response refers to URL ParsePath(List(models/createEdit),html,true,false) with parameters List()
INFO - Service request (GET) /models/createEdit/Create returned 0, took 11 Milliseconds

which means the rewrite was triggered.

I’m using Lift 2.4-M3 with Scala 2.9.0-1.

Anyone has any idea what is the problem?

Thanks.

Edit: changed code sample and added console output to make what is happening clearer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:43:43+00:00Added an answer on May 24, 2026 at 8:43 pm

    First, don’t use the Rewrite stuff. It’s low level and generally isn’t necessary.

    If you want a parameterized Menu entry, use Menu.param. See http://simply.liftweb.net/index-3.2.html#toc-Subsection-3.2.7

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following rewrite URL: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Rewrite
I have the following list of URLs to rewrite: 1 write url /products/ client
I have the following URL: http://testhost.com/offers/311/133/test@test.com/ and I'm wanting to redirect it to this
I have following url http://domain/phpfile.php/something1-param1/something2-param2/somethin3-param3 Can i rewrite it with htaccess to http://domain/phpfile.php?something1=param1&something2=para2&something3=param3 also
I have a rewrite rule of the following form: RewriteRule ^foo/([a-zA-Z0-9]+)$ foo.php?arg=$1 [qsa,nc] It
I have following Code Block Which I tried to optimize in the Optimized section
I have the following rewrite rules in my .htaccess file: RewriteEngine on RewriteRule ^news/([0-9]+)/?$
I have the following rewrite rules: <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / # Route
I have the following rewrite rule rewrite ^/ab(.*)/(.*)$ /repo/ab$1/rtest/$2 break; When the request file
I have the following mod_rewrite rule: RewriteRule ^([^/.]+)/?$ search.php?action=procedure&procedureName=$1 This works fine in redirecting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.