Better use REQUEST_URI, not REDIRECT_URL, because it's what has been requested, not what the provider gives you after e.g. a .htacces-redirect.