Move redirect to public/js/redirect.js