We have a CISCO hardware load balancer with two web servers behind it. We'd like to force some URLs to only be served by one of the machines.
Firstly, is the job of the load balancer? or would a better approach be create a subdomain such as http://assets.example.com which would be automatically be routed to one of the servers?
Yeah, you can do that if you want, although if you're certain you want to do that then why not just assign the DNS entry to the specific server IP rather than the cluster VIP?
without specific model information, yes the loadbalancer can take specific server in and out of service gracefully. That is one of the reasons to use a loadbalancer. Load balancers are reverse proxies (in the simplest form), but usually add additional functionality (layer 7 routing, health checks etc). It's usualy very simple to take a server out of service with a loadbalancer.
This is generally the job of a reverse proxy if you don't use a separate domain, and I am not sure if that CISCO hardware balancer does that. Apache and Nginx can be used as reverse proxies, and you would have regex rules that redirect things that match to specific servers.
I would recommend the other domain (assets.example.com) assuming you are talking about static content. That happens to be what stackoverflow does with their static content using sstatic.net.
Some advantages of the second domain:
You don't need to use the cookies on the domain for static content, and that saves some overhead (Yahoo blurb about this here, Google blurb here) . From sstatic.net:
If your domain is www.example.org, you can host your static components on static.example.org. However, if you've already set cookies on the top-level domain example.org as opposed to www.example.org, then all the requests to static.example.org will include those cookies. In this case, you can buy a whole new domain, host your static components there, and keep this domain cookie-free. Yahoo! uses yimg.com, YouTube uses ytimg.com, Amazon uses images-amazon.com and so on.
I would also think that if you architect for the second domain, if you ever decide to move to a CDN everything will be pretty much in place for that. The second domain, to me, feels more modular and I modularity is generally a good thing.