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 6863791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:49:48+00:00 2026-05-27T02:49:48+00:00

I am using the URLRewrite Filter from tuckey ( http://www.tuckey.org/urlrewrite/ ) Now i created

  • 0

I am using the URLRewrite Filter from tuckey ( http://www.tuckey.org/urlrewrite/ )

Now i created some rules, but there is one case which gives me headaches.
The URL: /group/1/update should be rewritten as: /group?id=1&action=update

I created a regexp Pattern for this case: ^/group/([0-9]+)/(\w*)$, but the Filter is unable to rewrite it. There is no match.

Inside my TestCase i ran this url through all my patterns, just to check. And i found the match as i expected.

assertFalse( "/group/1/update".matches("^/group/create$") );
assertFalse( "/group/1/update".matches("^/group/save$") );
assertFalse( "/group/1/update".matches("^/group/([0-9]+)/?$") );
assertTrue( "/group/1/update".matches("^/group/([0-9]+)/(\\w*)$") );
assertFalse( "/group/1/update".matches("^/group/([0-9]+)/(\\w*)\\?(.*)+$") );

So how come the Filter is unable to find a Rule?

Just to include everything, here is my urlrewrite.xml, or part of it:

<rule>
    <from>^/group/create$</from>
    <to>/group?action=create</to>
</rule>
<rule>
    <from>^/group/save$</from>
    <to>/group?action=save</to>
</rule>
<rule>
    <from>^/group/([0-9]+)/?$</from>
    <to>/group?id=$1&amp;action=show</to>
</rule>
<rule>
    <from>^/group/([0-9]+)/(\\w*)$</from>
    <to>/group?id=$1&amp;action=$2</to>
</rule>
<rule>
   <from>^/group/([0-9]+)/(\\w*)\\?(.*)+$</from>
    <to>/group?id=$1&amp;action=$2&amp;$3</to>
</rule>

Bye

Adrian

  • 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-27T02:49:49+00:00Added an answer on May 27, 2026 at 2:49 am

    You should use single backslash \ instead of double backslash \\.

    <rule>
        <from>^/group/([0-9]+)/(\w*)$</from>
        <to>/group?id=$1&amp;action=$2</to>
    </rule>
    <rule>
        <from>^/group/([0-9]+)/(\w*)\?(.*)+$</from>
        <to>/group?id=$1&amp;action=$2&amp;$3</to>
    </rule>
    

    In Java code, the double backalsh is used to represent a single backslash. Since the string is read from external file, there is no need the escape the backslash.

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

Sidebar

Related Questions

I am using tuckey URLRewrite filter having one of its rules as follows: <rule>
I have rewrited url from: http://www.xyz.com/Sample/showSamples-ASA21DS to: http://www.xyz.com/Sample/showSamples.do?sampleId=ASA21DS using urlRewrite.xml <urlrewrite> <rule> <from>^/http://www.xyz.com/Sample/showSamples-ASA21DS</from> <to>http://www.xyz.com/Sample/showSamples.do?sampleId=ASA21DS</to>
I am using org.tuckey.web.filters.urlrewrite.UrlRewriteFilter on my java project.It works fine .My issue is it
A Spring app I'm using declares a Tuckey UrlReWrite Filter and then sets up
I'm using http://urlrewriter.net/ to rewrite urls at my website. For example, I'm rewriting: http://www.example.com/schedule.aspx?state=ca
I have set up some User Friendly URL rules in IIS7 using the URL
Domain Description I am using a combination of Spring + Hibernate + Tuckey Urlrewrite
I am trying to replace relative url from /abc/bbc.do?count=1 with /bbc.do?count=1 using urlrewritefilter but
Using Spring Framework here... I created a filter to change the response body of
I have a problem using JSF 2.0, PrimeFaces and the tuckey.org UrlRewriteFilter. The problem

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.