Added conditional to ignore non-main query queries and the admin panel.

redirect() was running on every query: menus, custom queries, the admin panel, etc.