Add more conditions to avoid redirect

e.g. for system/ajax calls, and admin menu URLs.