Simple question It is possible to method to rewrite an url with mod_rewrite with different mysql/php request?

Things I want: If the IP is incorporated in the Banned_IP table I wish to redirect to /banned.php

Company, I have browse the apache documentation on RewriteMaps, that we find really perplexing, and I have researched to have an hour and 90% of ppl stated it could not be achieved(the relaxation known towards the apache documentation).