Add more conditions to avoid redirect.
Merge pull request #60 from Gizra/no-redirect

Add more conditions to avoid redirect.