Fix #48 : Rewrite redirect URL pattern generation code