Redirecting properly and not if in dev mode.