When you are using virtual hosts (several different hosts on the same IP address), web servers know how to differentiate by looking at the host header in the request. iptables can't do that, so you won't be able to use that.
Are we talking about URLs in the sense of forwarding requests to the proper web server? Can't you just use virtual hosts within Apache to take care of that? That way
www.mypage1.com and
www.anothersite.com, on the same IP address, can have different content based on the hostname.
I'm not exactly clear on what your purpose is, so I'm not really sure what else to suggest.