I have an iRule that blocks users from using an ip address to access our sites and also stops the wrong URL accessing it (this was done because of an error in a forwarding rule on our proxy).
...
You could use a class/data group that contains all of the allowed URLs and if HTTP::uri doesn't start with one of them, issue the same response. Is that what you're after?