I have a rewrite rule that points /example to example.domain.com, which works perfectly.

How can I lock that down so only a specific IP can access that?

I know how to do it if the directory is hosted on the local apache server, but I'm not certain if the rule will apply to a rewrite.

Has anyone had experience doing this?