6 Years
Discussion Span
Last Post by Brillig

So should I configure it from the domain name configuration (the site I bought the domain) or the web hosting configuration?


Are you directly serving pages via Tomcat or using some sort of webserver as front end (e.g. Apache web server, Nginx etc.)?

If you are using Apache, use something along the lines of mod_rewrite for Apache. I've never personally used it but heard that it can do wonders when it comes to manipulating URL's. I'm sure something similar exists for Nginx. If you are using a pure servlet front end, you might want to look into the UrlRewriteFilter. Please refer the appropriate documentation and relevant forum for finer configuration details or for help in getting started with the same.

Edited by ~s.o.s~: n/a


Some might find this a bit klugy (and maybe it is), but I've accomplished this by setting up a custom 404 page to go to a jsp page. Then that jsp page can grab the requested url string and parse it out and forward (NOT redirect) as you see fit. Works pretty nicely for me.

Just don't forget to change the header back to 200 before you redirect. Also, make sure you use a forward (server side) and not a redirect (client side).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.