Shorten website url in a web.xml file. Using Jetty

311 Views Asked by At

I'm trying to shorten the urls of my website in a web.xml file located on my Jetty server.

If my url is www.website.com/about.html

and I want to make it www.website.com/about

what would I need to add to web.xml?

Thank you.

1

There are 1 best solutions below

2
On

I would recommend resorting to either a custom javax.servlet.Filter where you could just do a simple HTTP forward about to about.html. You could then register that filter in your web.xml.

Another simpler option to checkout is this project which allows more complicated url rewriting.

https://code.google.com/p/urlrewritefilter/