I am using the answer given here as the basis for trying to add a rewrite rule to my web.config file. I want it to match any url that is not running on localhost in order to
Try this condition:
Using a negate condition against the localhost pattern should do the trick.
negate
localhost