middleware to strip url prefix