improve restricted URL handling