Moved Permanently

From Resin 3.0

Revision as of 01:56, 29 September 2010 by Ferg (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

When your website moves a URL or a whole section, you can use the <resin:MovedPermanently> rewrite-rule to redirect browsers to the new location.


In this example, we're redirecting a URL within the same web-app to a new location. /old gets moved to /new.

<web-app xmlns=""

  <resin:MovedPermanently regexp="^/old" target="/new"/>


As part of Resin's rewrite capability, the <resin:MovedPermanently> rule will match if the URL matches the given regular expression. The "^/old" matches the beginning of the URL, so it doesn't match "/foo/old" by mistake.

As with all the rewrite rules, the first matching rule is used. If no rule matches, Resin's regular servlet dispatching applies.

Personal tools