What is it?
is a Java Servlet Filter that allows an admin to implement simple redirections in a web application, without any programming involved. It is very simple to set up and allow for a highly configurable usage. The setup is done in the WEB-INF/web.xml
file of the web app. In some specific cases, it may even be the only content in this file.
Who is it for?
is designed for anyone wanting a redirect in a servlet container. Use cases include, but are not limited to:
- Admins that manage a webserver whose servlet container is serving pages directly. People with an httpd in front of their container have other options, but they may still want to use it.
- Your domain is mydomain.com? You most certainly want your website to respond to http://mydomain.com as well as http://www.mydomain.com. Have a look at the example 1.
- Some URLs of your website have changed and you want people accessing the old URLs to be redirected to the new ones (including Google and other bots).
- You want some of your site to be viewed exclusively with https (and other parts exclusively with http). Have a look at the example 1.
How does it work?
First, you should make RedirectFilter
available to your web app. This can be done by downloading pieroxy-tools.jar
and drop it in the WEB-INF/lib
of your web app.
At this point, you are ready to use it. You should edit your WEB-INF/web.xml file to setup your redirections. See the next section for detailed informations.
Read the setup instructions & configuration options here.
Examples of typical setups
Typical setups can be found here.