I've got a following problem. Some third party site domain www.xxx.com was pointed for an Ip in our site - www.oursite.com. So essentially, being able to access xxx.com reveals oursite.com (however with xxx.com visible within the browser)

I had been playing arounf with apache redirection however i can't manage to really make it work. First I attempted redirection for given xxx.com address. I Quickly sought out a method to redirect from the incoming domain. No luck both in situations. Are you able to help ?

RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^/*(.*)$ http://www.example.com/$1 [R=301,NC]

Will redirect all demands that aren't for "www.example.com", to "www.example.com".