fix redirect to use the basedir config