redirect to slash when requesting directory
prevent index out of range when path is ""