[#1675] Fix for exponential execution time problem in Controller.redirect()

As far as I can tell the regex used in Controller.redirect() can be substituted with a simple indexOf().