handle rewrite when requestURI has query string attached