introduce before/after hooking mechanism for redirects.