* Fix static handler redirect logic to ensure proper clean up URLs before redirection. (cherry picked from commit f50ec8e0d10c24fd79f6c454974a2fc6e9694ef2)