I moved this out of `base.js` into here. base.js will perform the redirect if necessary.