Fix base URL bugs + redirects