Using the flag R=301, you're performing a redirect instead of only rewriting the URL internally. Remove that and everything should work fine
R=301