ensure redirects use the correct base URL