AI OnAI Off
The no-code way to achieve this is to use the "Simple address" property for the page. But it won't let you remove arbitrary folders while keeping some - it will remove all url segments and replace it with the simple address. The "long" url is of course always valid too.
If you need to have more control, i.e. remove arbitrary segments of the url you will have to code your own url rewriter, or wire your own routing...