start of the base path redirect stuff.