improved check for rule redirection
Merge pull request #40 from yogthos/master

improved rule matching