Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I came across an issue where I saw a domain xyz.com that is pointing to mydomain.com.

How do I prevent spam domains from pointing to my domain? I read some posts about setting my virtual hosts and such, but nothing specific about how to prevent it in the first place.

I searched on Google, but most answers are for Apache or IIS, and I'm using Tomcat 7 to serve content directly.

share|improve this question
    
It is likely a server at your web host. Provide the domain that is redirecting. You can back trace it to the source, likeihood its a matter of contacting your web host. –  bybe Apr 2 '13 at 11:50
add comment

2 Answers

If the offending domain is showing a copy of your site, then you certainly want to avoid letting it continue lest you end up getting penalised for duplicate content. This post on Stack Overflow appears to have a helpful answer for your case, since you know the domain that's the problem:

There isn't a way to set this up as easily as you're able to with Apache. The closest thing would be to make a servlet or jsp to handle the redirect and then map it to the URL you want to redirect from.

As @bybe mentioned, contact your hosting company and ask if they can do anything to help. It would also be worth tracing the domain back to its registrar and contacting their technical support to see if they'd be willing to get involved.

share|improve this answer
add comment

Anyone can point their DNS at your IP address. If you don't have control over that domain then there is nothing you can do, but nothing you need to do. Just ignore it and/or do a 301 redirect to your preferred domain for requests with a different domain in the header.

In a shared hosting environment multiple sites can run on the same address, it is quite normal for multiple unrelated domains to point to the same IP address although these requests should not hit your actual site.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.