fix trailing slashes

Make all addresses ending with `/directory/`  resolve to `/directory`.