Redirects - Documentation topics on: redirect,redirects,.


In Velocity, you can set redirects directly from a page or template without any external scripting. For example, you can add


to the top of pages or in your templates. This will send a 302 (temporary) redirect to the visitor's browser.  In case you need to control the redirect status (301/302), you can do the following:

$response.setHeader("Location", "$YOUR_NEW_URL")

Because the above code is setting HTTP Headers, the code needs to be placed at the top of the page, before any html code to be sent to the browser/client.

Via Rewrite Rules (mod_rewrite)

If you have more complex rewrite needs, we suggest using the included RewriteRule filter which supports mod_rewrite like syntax and rewriting.