Switch the order of REQUEST_URI and REDIRECT_URL. Tentative fix for #591.