Fix EZP-23364

Trailing slash should not redirect, so you should keep the `rtrim`.