Issue #2: Fix redirect issue with arbitrary URLs