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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:02:04+00:00 2026-06-14T16:02:04+00:00

I am facing some weird issue . Executing one rule ( last rule )

  • 0

I am facing some weird issue . Executing one rule ( last rule ) is putting to url to times before forwarding which is giving me 404 error .

web.xml content

    <filter>
  <filter-name>UrlRewriteFilter</filter-name>
  <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
  <init-param>
    <param-name>logLevel</param-name>
    <param-value>DEBUG</param-value>
  </init-param>
</filter>
<filter-mapping>
  <filter-name>UrlRewriteFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <!-- FORWARD dispatcher will keep on parsing requests through rule until
     atleast one rule is applied . It sometime may lead into infinite loop
     --> 
  <!--    <dispatcher>FORWARD</dispatcher>  -->
</filter-mapping>

My rules

<rule>
    <name>DepreatedUrls</name>
    <from>(/my/url2|/my/url3)</from>
    <set type="status">410</set>
    <to last="true">%{context-path}/error/410.html</to>
</rule>

<rule>
    <name>AllRemainingRequests</name>
    <note>
        This rule will block all other requests and return http error
        404 ( not supported ) and custom error message .
    </note>
    <from>(.*)</from>
    <set type="status">404</set>
    <to last="true">/error/410.html</to>
</rule>

All other rules are executing fine . Every rule is last rule ( last=”true”) .
But when last rule is executed it forwards the request to
/error/410.html/error/410.html

I have removed most of the rule definition to keep it simple . Following is the debug logs

Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: AllRemainingRequests (rule 8) run called with /some-content
Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: matched "from"
Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.SetAttribute DEBUG: set Set status null 404 called
Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.SetAttribute DEBUG: setting status
Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.RuleExecutionOutput DEBUG: needs to be forwarded to /error/410.html/error/410.html
Nov 20, 2012 12:31:10 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: rule is last
  • 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-06-14T16:02:05+00:00Added an answer on June 14, 2026 at 4:02 pm

    With some hit and trial I found the solution .
    “from” component for AllRemainingRequests is troubling .
    When I put following definition for AllRemainingRequests it works fine .

    <rule>
        <name>AllRemainingRequests</name>
        <from>(/.*)</from> 
        <set type="status">404</set>
        <to last="true">/error/410.html</to>
    </rule>
    

    Only change is “/”

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

Sidebar

Related Questions

I'm facing some weird css issue with django . My css works fine but
Facing some weird moment of my career. I have some uitextfield's and one uitextview
We are facing a weird issue and need some brain storming here. I will
Facing some issue in Talend Admin Console, the jobs that are running from IDE
I am using mysql and facing some problem. I want to retrieve last row
Hello to all I am here facing some situation of detecting url in asp.net
My development team of four people has been facing this issue for some time
I have created web-application using JSF 2.0 & JSP and facing some weird problem.
I am facing some issue i beleive you could help me. The Scenario is
I am a EntityFramework newbie. I am facing a very weird issue. I am

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.