You can intercept calls on your 404 page and redirect them.
You can access the request with this:
Don't trust that code, it's just pseudocode and totally untested. There might be a smarter way to get the last character.
Hrm, maybe this instead - it's not the 'proper' technique but I think it's a lot easier to parse and understand.
Regardless, put this at the very top of your 404 page code because you want that sendRedirect to happen before any HTML output at all.
If you are going this route, tell us your version and we can tell you how to access the 404 page code.
Lastly, I am sure you can fix this in the OS, if you have access (mod_rewrite in Apache, for example) but that's not really a dotCMS question.